Skip to content

DeebeshS-ML/Decision-Tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Decision Tree Classification

Overview

This project implements a Decision Tree classifier to predict the presence of heart disease based on various patient health attributes. The workflow includes exploratory data analysis, model training, decision tree visualization, and evaluation of classification performance.


Objective

The objective of this project is to build a machine learning model capable of predicting heart disease using a Decision Tree algorithm. The model helps identify patterns associated with heart disease and provides insights for early risk assessment.


Dataset

The dataset contains medical attributes related to patients, including:

  • Age
  • Sex
  • Chest pain type
  • Resting blood pressure
  • Cholesterol level
  • Maximum heart rate achieved
  • Exercise-induced angina
  • ST depression
  • Other clinical measurements
  • Target variable indicating heart disease presence

Technologies Used

  • Python
  • Pandas
  • NumPy
  • Matplotlib
  • Seaborn
  • Scikit-Learn
  • Decision Tree Classifier
  • Graphviz
  • Pydotplus

Key Tasks Performed

  • Loaded and explored the heart disease dataset.
  • Performed exploratory data analysis to understand feature distributions.
  • Identified input features and target variable.
  • Split the dataset into training and testing sets.
  • Built a Decision Tree classification model.
  • Trained the model using Scikit-Learn.
  • Visualized the decision tree structure.
  • Evaluated the model on unseen data.
  • Interpreted important factors influencing heart disease prediction.

Workflow

  1. Data Loading
  2. Exploratory Data Analysis (EDA)
  3. Data Preprocessing
  4. Feature and Target Separation
  5. Train-Test Split
  6. Decision Tree Model Building
  7. Model Training
  8. Tree Visualization
  9. Model Evaluation
  10. Interpretation of Results

Model Evaluation

The model performance was evaluated using:

  • Training and testing datasets
  • Prediction analysis
  • Classification metrics
  • Decision tree visualization

Project Structure

decision-tree-classification
│
├── decision_tree_classification.ipynb
├── README.md
├── requirements.txt
├── dataset.csv
└── images/

Results

The Decision Tree model successfully learned patterns from patient health data and provided predictions for heart disease classification. The tree visualization improved model interpretability and helped understand the factors contributing to heart disease.


Future Improvements

  • Perform hyperparameter tuning to improve model performance.
  • Compare Decision Tree with Random Forest and XGBoost models.
  • Apply cross-validation techniques.
  • Deploy the model using Streamlit or Flask.
  • Create interactive visualizations for better analysis.

Author

Deebesh Sundar

Machine Learning & Data Science | NLP Practitioner

GitHub: https://github.com/DeebeshS-ML

About

Classification using Decision Tree algorithm with model evaluation and visualization.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors