This is a Python implementation of a Decision Tree classifier. It includes methods for loading data from a CSV file, building a decision tree, making predictions, and evaluating the model's performance using various metrics.
- Load data from a CSV file.
- Build a decision tree classifier.
- Predict class labels for new instances.
- Evaluate the model's performance using accuracy and other metrics.
- Generate a learning curve to analyze the model's performance with different training set sizes.
- Python 3.x
- matplotlib
-
Clone the repository:
git clone https://github.com/your-username/decision-tree-classifier.git
Change to the project directory:
cd decision-tree-classifier
Install the required dependencies:
pip install -r requirements.txt
Prepare your dataset by creating a CSV file with the appropriate format. Make sure the last column represents the class labels.
Update the code in decision_tree.py as needed. You may modify the DecisionTree class to add additional functionality or customize the behavior.
Train and evaluate the decision tree classifier:
python decision_tree.py
This will load the dataset, split it into training and testing sets, train the model, and evaluate its performance using various metrics.
Review the evaluation metrics, confusion matrix, and learning curve generated by the script.
Contributions to this project are welcome. If you would like to contribute, please follow these steps:
-
Fork the repository.
-
Create a new branch.
-
Make your enhancements or bug fixes.
-
Create a pull request with a descriptive title and explanation of your changes.
This project is licensed under the MIT License.
For any questions or suggestions, please feel free to reach out :
Name: Anas Sohail Zafar
Email: anassohailzafar@gmail.com
GitHub: github.com/AnasSohailZafar
Linkedin: www.linkedin.com/in/anas-sohail-zafar123