📖 Project Overview
The HeartGuard Classification System is a diagnostic-focused machine learning solution designed to identify heart attack risks based on physiological indicators. Developed as part of the Codiom initiative, this project implements a rigorous pipeline—from raw clinical data processing to production-ready model deployment.
By analyzing critical medical markers such as blood pressure, cholesterol levels, and heart rate, the system categorizes patients into risk tiers, providing healthcare professionals with a data-driven secondary opinion.
✨ Key Features
- 🔍 Clinical EDA Pipeline: Visualizing feature distributions (age, sex, chest pain type) and their direct impact on cardiac health outcomes.
- 🛠️ Advanced Medical Data Preprocessing:
- Handling Imbalance: Strategies to ensure fair prediction across different patient demographics.
- Statistical Scaling: Robust standardization of skewed medical metrics using
StandardScaler.
- Feature Selection: Identifying the most significant clinical predictors to reduce model noise.
- 🤖 Optimized Classification Engine: Utilizing a suite of algorithms (Logistic Regression, Random Forest, or SVM) optimized for high Recall—crucial in medical diagnostics.
- 💾 Model Persistence: Automated serialization of the trained classifier for real-time risk assessment in clinical environments.
- 📊 Error Analysis: Comprehensive evaluation through confusion matrices to minimize false negatives in cardiac risk detection.
🛠️ Tech Stack
| Category |
Technology |
Usage |
| Development |
Python 3.9+ |
Mathematical logic and framework orchestration. |
| Data Engine |
Pandas / NumPy |
Clinical data manipulation and cleaning. |
| ML Framework |
Scikit-Learn |
Model training, cross-validation, and metrics. |
| Visualization |
Matplotlib / Seaborn |
Clinical trend analysis and performance plotting. |
| Deployment |
Joblib / Pickle |
Fast serialization for inference ready models. |
🏗️ Technical Architecture
The system utilizes a structured Classification Pipeline to ensure deterministic and reproducible diagnostic results.
Mathematical Validation (Metrics)
In medical AI, precision and sensitivity are paramount. The model is strictly validated using:
- Accuracy Score: Overall percentage of correct classifications.
- Recall (Sensitivity): Critical metric for minimizing missed cardiac events.
$$Recall = \frac{TP}{TP + FN}$$
- F1-Score: Harmonic mean of precision and recall for balanced evaluation.
$$F1 = 2 \times \frac{Precision \times Recall}{Precision + Recall}$$
📂 Project Structure
.
├── 📁 data/
│ └── Heart.csv # Anonymized clinical dataset
├── 📄 main.py # Classification Pipeline (EDA -> Train -> Export)
├── 📄 test_model.py # Script for individual risk predictions
├── 📁 models/
│ ├── classifier.pkl # Serialized Intelligence Engine
│ └── scaler.pkl # Pre-fitted Clinical Parameters
├── 📄 requirements.txt # System dependencies
└── 📄 README.md # Documentation
🚀 Installation & Getting Started
1. Environment Setup
# Clone the repository
git clone [https://github.com/BerattCelikk/Heart_Attack_Classficiation.git](https://github.com/BerattCelikk/Heart_Attack_Classficiation.git)
cd Heart_Attack_Classficiation
# Initialize environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
2. Install Dependencies
pip install -r requirements.txt
3. Execution
Train the model from scratch:
python main.py
Test the model on new data:
python test_model.py
🗺️ Roadmap
评论