This project leverages machine learning algorithms to predict whether a tumor is benign or malignant using biomedical data. Various classification models are explored, and the best-performing model is selected based on its performance.
The project follows these steps:
- Data Loading: Downloading the dataset from OpenML.
- Data Exploration and Preparation:
- Analyzing dataset dimensions.
- Assigning descriptive names to columns.
- Visualizing the distribution of target classes.
- Model Training:
- Training and evaluating several classification models:
- Random Forest
- Logistic Regression
- Support Vector Machine (SVM)
- Gradient Boosting
- Cross-validation to compare model performance.
- Training and evaluating several classification models:
- Hyperparameter Tuning:
- Using
GridSearchCV
to optimize hyperparameters of the Gradient Boosting model, selected as the best-performing model.
- Using
To run the project, you need the following dependencies:
- Python 3.7+
- Python libraries:
openml
pandas
numpy
scikit-learn
seaborn
matplotlib
Install the dependencies using:
pip install openml pandas numpy scikit-learn seaborn matplotlib
The project is documented in a Jupyter notebook. The main structure includes:
- Introduction: Brief description of the problem and objectives.
- Data Loading and Exploration:
- Loading the dataset from OpenML.
- Initial exploratory analysis (dimensions, data types, class distribution).
- Model Training and Evaluation:
- Comparing different models using metrics such as
precision
,recall
, andF1-score
. - Visualizing results with plots.
- Comparing different models using metrics such as
- Best Model Optimization:
- Hyperparameter tuning with GridSearchCV to improve the accuracy of the Gradient Boosting model.
- Conclusions: Summary of results and future steps.
Follow these steps to run the notebook:
-
Clone the repository:
git clone https://github.com/Unai1117/BreastCancerBenignOrMalignant.git
-
Navigate to the project directory:
cd project_name
-
Open the notebook in Jupyter:
jupyter notebook tumor_prediction.ipynb
-
Execute the cells sequentially to reproduce the analysis and results.
The optimized model (Gradient Boosting) achieved the following results:
- Key Metrics:
- Accuracy: 98%
- Recall: 97%
- F1-Score: 97%
Detailed insights can be found in the hyperparameter tuning section and the classification reports generated by the models.
Contributions are welcome. To improve the project or add new features, follow these steps:
- Fork the repository.
- Create a branch for your feature:
git checkout -b new_feature
- Commit your changes:
git commit -m "Description of changes"
- Push your changes and submit a pull request.