# amiraabdel-rahman/breast_cancer_with_nn architecture

> Architecture diagram of the GitHub repository amiraabdel-rahman/breast_cancer_with_nn, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amiraabdel-rahman/breast_cancer_with_nn
- Repository: https://github.com/amiraabdel-rahman/breast_cancer_with_nn

## Overview

#### Purpose and Entry Point
This is a notebook-centric binary classification project for predicting malignant versus benign breast tumors from 30 numeric FNA-derived measurements. The complete executable workflow is in `Breast_Cancer.ipynb`; there is no separate application package, service, or deployment entry point.

#### Data Boundary
The training dataset is sourced through scikit-learn’s Wisconsin Breast Cancer loader, as documented in `README.md`. A repository-local `data.csv` is also present, but the documented pipeline identifies `sklearn.datasets.load_breast_cancer()` as the source. The model boundary is tabular input: 30 ordered numerical features produce one of two diagnostic classes.

Paths: `Breast_Cancer.ipynb`, `data.csv`, `README.md`

#### Exploration and Dataset Preparation
The notebook first inspects dataset shape, data types, nulls, class balance, and descriptive/group statistics. It separates feature matrix `X` from target `Y`, then creates an 80/20 train/test split using `random_state=2`. This split isolates final evaluation data from fitting stages.

Path: `Breast_Cancer.ipynb`

#### Feature Transformation
`StandardScaler` is fit on training features and applied to both training and test inputs. Scaling is the principal preprocessing contract between raw dataset columns and the neural-network input; inference samples must preserve the same feature order and use the fitted scaling transformation.

Path: `Breast_Cancer.ipynb`

#### Model and Training Stage
The classifier is a TensorFlow/Keras Sequential neural network: flattened 30-feature input, a 20-unit ReLU dense hidden layer, and a two-unit sigmoid output layer. It uses Adam optimization, sparse categorical crossentropy, accuracy reporting, 10 epochs, and a 10% validation split from the training data.

Path: `Breast_Cancer.ipynb`

#### Evaluation and Prediction Flow
Training yields history used to plot training/validation accuracy and loss. The held-out test set is evaluated for final loss and accuracy. A separate sample-prediction path accepts a manually supplied 30-value tumor record, transforms it consistently with training data, runs model inference, and maps the predicted class to benign or malignant output.

Path: `Breast_Cancer.ipynb`

#### Runtime and Dependencies
Execution requires a Jupyter-compatible Python environment with TensorFlow/Keras, scikit-learn, NumPy, pandas, and Matplotlib. The repository has no declared cloud infrastructure, API, persistent model artifact, model-serving runtime, or external online service dependency.

Paths: `Breast_Cancer.ipynb`, `README.md`

Main entry points: [`Breast_Cancer.ipynb`](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb) (StandardScaler), [`README.md`](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/README.md) (Project documentation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_notebook["Notebook workflow"]
  node_notebook_entry["Breast Cancer notebook<br/>workflow entry"]
  node_sklearn_loader["Wisconsin dataset loader<br/>scikit-learn source"]
  node_dataset[("30-feature tumor dataset<br/>tabular dataset")]
  node_exploration["Dataset exploration<br/>notebook analysis"]
  node_split["80/20 train-test split<br/>data partition"]
  node_scaler["StandardScaler<br/>preprocessing"]
  node_scaled_train["Scaled training features<br/>model input"]
  node_scaled_test["Scaled test features<br/>evaluation input"]
  node_keras_model["Keras classifier<br/>neural network"]
  node_training["Model training<br/>fit stage"]
  node_history["Training history<br/>metrics history"]
  node_plots["Accuracy and loss plots<br/>visualization"]
  node_evaluation["Held-out evaluation<br/>model evaluation"]
  node_manual_record["Manual 30-value record<br/>prediction input"]
  node_diagnosis["Benign or malignant output<br/>prediction result"]
end

subgraph group_runtime["Python runtime"]
  node_python_env{{"Jupyter Python environment<br/>runtime"}}
end

node_readme["Project documentation<br/>README<br/>[README.md]"]
node_local_csv["Repository-local CSV<br/>data file<br/>[data.csv]"]

node_python_env -->|"executes"| node_notebook_entry
node_readme -.->|"documents source"| node_sklearn_loader
node_sklearn_loader -->|"loads"| node_dataset
node_dataset -->|"inspects"| node_exploration
node_dataset -->|"partitions X and Y"| node_split
node_split -->|"fits on train features"| node_scaler
node_scaler -->|"transforms train"| node_scaled_train
node_split -->|"provides test features"| node_scaled_test
node_scaler -->|"transforms test"| node_scaled_test
node_scaled_train -->|"fits classifier"| node_training
node_keras_model -->|"training target"| node_training
node_training -->|"produces"| node_history
node_history -->|"visualizes"| node_plots
node_training -->|"trained model"| node_evaluation
node_scaled_test -->|"held-out inputs"| node_evaluation
node_manual_record -->|"uses fitted transform"| node_scaler
node_scaler -->|"scaled sample"| node_diagnosis
node_keras_model -->|"infers class"| node_diagnosis

click node_notebook_entry "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb"
click node_sklearn_loader "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb"
click node_dataset "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb"
click node_exploration "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb"
click node_split "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb"
click node_scaler "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb"
click node_scaled_train "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb"
click node_scaled_test "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb"
click node_keras_model "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb"
click node_training "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb"
click node_history "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb"
click node_plots "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb"
click node_evaluation "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb"
click node_manual_record "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb"
click node_diagnosis "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb"
click node_python_env "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb"
click node_readme "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/README.md"
click node_local_csv "https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/data.csv"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_notebook_entry,node_sklearn_loader,node_dataset,node_exploration,node_split,node_scaler,node_scaled_train,node_scaled_test,node_keras_model,node_training,node_history,node_plots,node_evaluation,node_manual_record,node_diagnosis toneBlue
class node_python_env toneAmber
class node_readme,node_local_csv toneNeutral
```

## Components

### Notebook workflow

All executable stages run in one notebook.

- [Breast Cancer notebook](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb): workflow entry · Notebook-centric training, evaluation, and prediction workflow. · `Breast_Cancer.ipynb`
- [Wisconsin dataset loader](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb): scikit-learn source · Loads labeled breast-cancer measurements. · `Breast_Cancer.ipynb`
- [30-feature tumor dataset](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb): tabular dataset · Ordered numeric FNA measurements with benign/malignant labels. · `Breast_Cancer.ipynb`
- [Dataset exploration](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb): notebook analysis · Inspects schema, nulls, class balance, and statistics. · `Breast_Cancer.ipynb`
- [80/20 train-test split](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb): data partition · Uses random_state=2 to isolate held-out evaluation data. · `Breast_Cancer.ipynb`
- [StandardScaler](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb): preprocessing · Fit on training features and reused for test and sample inputs. · `Breast_Cancer.ipynb`
- [Scaled training features](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb): model input · `Breast_Cancer.ipynb`
- [Scaled test features](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb): evaluation input · `Breast_Cancer.ipynb`
- [Keras classifier](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb): neural network · 30-feature input, Dense(20 ReLU), then 2-unit sigmoid output. · `Breast_Cancer.ipynb`
- [Model training](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb): fit stage · Adam, sparse categorical crossentropy, 10 epochs, 10% validation split. · `Breast_Cancer.ipynb`
- [Training history](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb): metrics history · Captures training and validation accuracy and loss. · `Breast_Cancer.ipynb`
- [Accuracy and loss plots](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb): visualization · `Breast_Cancer.ipynb`
- [Held-out evaluation](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb): model evaluation · Reports final test loss and accuracy. · `Breast_Cancer.ipynb`
- [Manual 30-value record](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb): prediction input · Must preserve the training feature order. · `Breast_Cancer.ipynb`
- [Benign or malignant output](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb): prediction result · `Breast_Cancer.ipynb`

### Python runtime

- [Jupyter Python environment](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/Breast_Cancer.ipynb): runtime · Uses TensorFlow/Keras, scikit-learn, NumPy, pandas, and Matplotlib. · `Breast_Cancer.ipynb`

### Other components

- [Project documentation](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/README.md): README · Documents the scikit-learn dataset source. · `README.md`
- [Repository-local CSV](https://github.com/amiraabdel-rahman/breast_cancer_with_nn/blob/main/data.csv): data file · Present locally but not identified as the documented pipeline source. · `data.csv`

## Connections

- Jupyter Python environment → Breast Cancer notebook: executes
- Project documentation → Wisconsin dataset loader: documents source
- Wisconsin dataset loader → 30-feature tumor dataset: loads
- 30-feature tumor dataset → Dataset exploration: inspects
- 30-feature tumor dataset → 80/20 train-test split: partitions X and Y
- 80/20 train-test split → StandardScaler: fits on train features
- StandardScaler → Scaled training features: transforms train
- 80/20 train-test split → Scaled test features: provides test features
- StandardScaler → Scaled test features: transforms test
- Scaled training features → Model training: fits classifier
- Keras classifier → Model training: training target
- Model training → Training history: produces
- Training history → Accuracy and loss plots: visualizes
- Model training → Held-out evaluation: trained model
- Scaled test features → Held-out evaluation: held-out inputs
- Manual 30-value record → StandardScaler: uses fitted transform
- StandardScaler → Benign or malignant output: scaled sample
- Keras classifier → Benign or malignant output: infers class
