How amiraabdel-rahman/breast_cancer_with_nn works
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 StandardScaler · README.md Project documentation
Components 18
Notebook workflow
All executable stages run in one notebook.
- Breast Cancer notebook · Notebook-centric training, evaluation, and prediction workflow.
Breast_Cancer.ipynb - Wisconsin dataset loader · Loads labeled breast-cancer measurements.
Breast_Cancer.ipynb - 30-feature tumor dataset · Ordered numeric FNA measurements with benign/malignant labels.
Breast_Cancer.ipynb - Dataset exploration · Inspects schema, nulls, class balance, and statistics.
Breast_Cancer.ipynb - 80/20 train-test split · Uses random_state=2 to isolate held-out evaluation data.
Breast_Cancer.ipynb - StandardScaler · Fit on training features and reused for test and sample inputs.
Breast_Cancer.ipynb - Scaled training features
Breast_Cancer.ipynb - Scaled test features
Breast_Cancer.ipynb - Keras classifier · 30-feature input, Dense(20 ReLU), then 2-unit sigmoid output.
Breast_Cancer.ipynb - Model training · Adam, sparse categorical crossentropy, 10 epochs, 10% validation split.
Breast_Cancer.ipynb - Training history · Captures training and validation accuracy and loss.
Breast_Cancer.ipynb - Accuracy and loss plots
Breast_Cancer.ipynb - Held-out evaluation · Reports final test loss and accuracy.
Breast_Cancer.ipynb - Manual 30-value record · Must preserve the training feature order.
Breast_Cancer.ipynb - Benign or malignant output
Breast_Cancer.ipynb
Python runtime
- Jupyter Python environment · Uses TensorFlow/Keras, scikit-learn, NumPy, pandas, and Matplotlib.
Breast_Cancer.ipynb
Other components
- Project documentation · Documents the scikit-learn dataset source.
README.md - Repository-local CSV · Present locally but not identified as the documented pipeline source.
data.csv
Connections 18
- 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