π§ Breast Cancer Classification using Feature Engineering & Model Comparison π Overview
This project focuses on building an accurate and interpretable classification model for breast cancer diagnosis using the Breast Cancer Wisconsin dataset. The goal is not only high performance but also understanding the underlying data structure and feature importance.
π― Objectives Perform in-depth Exploratory Data Analysis (EDA) Identify key predictive features Apply feature engineering to reduce dimensionality Compare multiple machine learning models Build a simple, interpretable, high-performing model π Exploratory Data Analysis (EDA) Key Findings: Dataset shows moderate class imbalance (~63% Benign, ~37% Malignant) Strong separation observed in: Size features β radius, perimeter, area Shape features β concavity, concave points, compactness Weak separation in: texture, symmetry, fractal dimension Multicollinearity: High correlation among: radius β perimeter β area Feature grouping identified: Size cluster Shape cluster βοΈ Feature Engineering
To reduce redundancy and improve interpretability:
size_score Captures tumor size shape_score Captures structural irregularity Insight:
A 2-feature representation preserves most of the predictive power.
π€ Models Used Logistic Regression Linear Discriminant Analysis (LDA) Quadratic Discriminant Analysis (QDA) K-Nearest Neighbors (KNN) π Model Performance Model Accuracy Malignant Recall Key Observation Logistic Regression 99% 0.98 Best overall KNN 95% 0.86 Sensitive to local overlap QDA 93% 0.83 Unnecessary flexibility LDA 90% 0.74 Strong assumptions fail π§ Key Insights Dataset is highly separable Size is the dominant feature Shape adds refinement Texture-based features add noise Simple models outperform complex ones π¬ Final Model
Using only:
['size_score', 'shape_score']
Achieved:
99% accuracy
Only 1 misclassification
Coefficient Insight:
Size has significantly higher impact than shape
Confirms EDA findings
π Decision Boundary
Clear linear separation
Minimal overlap between classes
Confirms suitability of linear models
The project demonstrates that breast cancer classification can be effectively solved using a low-dimensional, interpretable feature space. Tumor size and shape alone capture the majority of the predictive signal, making Logistic Regression the optimal choice.
π‘ Key Takeaway
Simplicity beats complexity when the data is inherently structured.
π Tech Stack Python Pandas, NumPy Matplotlib, Seaborn Scikit-learn π Future Improvements Cross-validation & robustness checks Threshold tuning for medical sensitivity ROC-AUC optimization Deployment-ready pipeline π€ Author