Skip to content

MuhammedEssam17/Heart-Disease-Classification-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Heart Disease Classification & Analysis 🩺🤖

This repository features a hands-on, practical implementation of fundamental Machine Learning algorithms applied to a clinical heart disease dataset. The project transitions from continuous baseline regressions to an optimized, multi-feature classification model.


🚀 Project Overview & Workflow

1. Dataset Overview

The project utilizes a clinical heart disease dataset (heart.csv) featuring essential medical indicators such as age, chol (cholesterol), thalach (maximum heart rate reached), and a binary target column indicating the presence of heart disease ($1 = \text{disease}$, $0 = \text{healthy}$).

2. Linear Regression Model (Continuous Prediction)

  • Goal: Predict a continuous target—specifically the patient's resting blood pressure (trestbps).
  • Features Used: age, chol, and thalach.
  • Methodology: The data was split into an 80% training set and a 20% testing set. The model was optimized minimizing the Mean Squared Error (MSE) via Gradient Descent.
  • Outcome: Successfully extracted the learned weights, bias, and a final Cost (MSE) of ~289.88.

3. Logistic Regression Model (Baseline Classification)

  • Goal: Transition into binary classification to predict whether a patient has heart disease (target).
  • Features Used: age, chol, and thalach.
  • Methodology: Evaluated using classification metrics (accuracy_score) through a standard sigmoid mapping framework.
  • Outcome: Achieved a baseline test classification accuracy of 63.90%.

4. Optimized Logistic Regression Model (Feature Expansion)

  • Goal: Maximize classification performance by unlocking the dataset's full diagnostic capacity.
  • Methodology: Dropped the target column to train the model on all available clinical features simultaneously. To ensure absolute mathematical convergence down the cost function landscape without bottlenecks, the maximum training iterations parameter (max_iter) was expanded to 3000.
  • Outcome: The evaluation accuracy sharply escalated from 63.90% to 79.51%, empirically validating the machine learning principle that rich, multi-dimensional feature representation yields superior model decision boundaries.

🛠️ Tech Stack & Environment

  • Language: Python
  • Environment: VS Code (Jupyter Notebooks)
  • Libraries: pandas, scikit-learn

About

A practical implementation of Linear and optimized Logistic Regression models on a clinical heart disease dataset.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors