Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gurpreet0022/cardio-tree-classifier
https://github.com/gurpreet0022/cardio-tree-classifier
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gurpreet0022/cardio-tree-classifier
- Owner: Gurpreet0022
- Created: 2024-11-13T08:28:25.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-13T08:48:25.000Z (2 months ago)
- Last Synced: 2024-11-13T09:32:17.855Z (2 months ago)
- Language: Python
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cardio Tree Classifier
This project, **Cardio Tree Classifier**, is designed to classify the likelihood of heart disease based on various health indicators. It uses a decision tree classifier to analyze a dataset of health information to make predictions on heart disease outcomes.
## Table of Contents
- [Project Overview](#project-overview)
- [Dataset](#dataset)
- [Installation](#installation)
- [Usage](#usage)
- [Model Training](#model-training)
- [Evaluation](#evaluation)## Project Overview
The **Cardio Tree Classifier** uses machine learning techniques to analyze factors associated with heart disease. This project applies data preprocessing techniques such as label encoding and one-hot encoding and builds a decision tree classifier model for prediction.## Dataset
The dataset used for this project is `heartDisease_2020_sampling.csv`, which contains various health indicators. These include:
- Heart disease diagnosis
- General health status
- Smoking and drinking habits
- Physical activity level
- Age category
- Race and gender information## Installation
1. Clone the repository:
```bash
git clone https://github.com/your-username/Cardio-Tree-Classifier.git
```
2. Navigate to the project directory:
```bash
cd Cardio-Tree-Classifier
```
3. Install the required dependencies:
```bash
pip install -r requirements.txt
```## Usage
1. Load and preprocess the dataset:
The code reads `heartDisease_2020_sampling.csv` and preprocesses it by label encoding categorical columns and one-hot encoding race information.
2. Train and evaluate the model:
- The decision tree classifier is trained on the processed data.
- Run the script to view sample data and training results.
3. Run the main script:
```bash
python main.py
```## Model Training
The model is trained using a decision tree classifier, with the following steps:
- **Data Cleaning**: Label encoding and one-hot encoding of categorical variables.
- **Model Selection**: Decision Tree Classifier.
- **Training and Prediction**: The model is trained on the preprocessed dataset.## Evaluation
The model's performance is evaluated using metrics such as accuracy, precision, recall, and F1 score.