https://github.com/dms-codes/decision-tree-breast-cancer
Breast Cancer Prediction with Decision Tree Classifier
https://github.com/dms-codes/decision-tree-breast-cancer
ai decision-tree machine-learning python
Last synced: 2 months ago
JSON representation
Breast Cancer Prediction with Decision Tree Classifier
- Host: GitHub
- URL: https://github.com/dms-codes/decision-tree-breast-cancer
- Owner: dms-codes
- Created: 2024-12-07T19:22:09.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-12-08T01:00:14.000Z (5 months ago)
- Last Synced: 2025-01-18T21:20:02.956Z (4 months ago)
- Topics: ai, decision-tree, machine-learning, python
- Language: Python
- Homepage: https://github.com/dms-codes/breast-cancer
- Size: 362 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Breast Cancer Prediction with Decision Tree Classifier
This Python script demonstrates the implementation of a Decision Tree Classifier for predicting breast cancer outcomes.
**Key Features:**
* **Data Loading and Preprocessing:**
- Loads breast cancer data from a CSV file.
- Cleans the data by removing rows with missing values.
- Preprocesses the data by:
- Encoding categorical variables using LabelEncoder.
- Scaling numerical features using StandardScaler.
* **Model Training and Evaluation:**
- Splits the data into training and testing sets.
- Performs hyperparameter tuning using Grid Search with Cross-Validation to find the best model configuration.
- Trains the Decision Tree Classifier with the optimal hyperparameters.
- Evaluates the model's performance using accuracy, classification report, and confusion matrix.
* **Visualization:**
- Visualizes the trained decision tree using `plot_tree()` for better understanding of the model's decision-making process.**Installation:**
1. Make sure you have the following libraries installed:
- pandas
- scikit-learn
- matplotlibYou can install them using pip:
```bash
pip install pandas scikit-learn matplotlib