amirsoahil101/Heart_stroke_prediction
0
๐ฅ Healthcare Patient Classification using KNN Model
This repository contains a fully trained K-Nearest Neighbors (KNN) classification model designed for healthcare risk profiling and clinical data prediction. The model processes tabular patient records to categorize health risks or diagnostic categories.
๐ Repository & Model Architecture
To ensure perfect reproducibility, the pipeline has been modularized into separate components. The repository consists of the following key artifacts:
- `knn.pickle`: The main trained K-Nearest Neighbors classifier model instance.
- `scale.pickle`: A trained
StandardScaler(orMinMaxScaler) used to normalize patient features, preventing distance-distortion in KNN. - `column.pickle`: A serialized Python list containing the precise order of feature columns required by the model.
- `healthcare_data.zip`: A compressed archive containing the training/validation data split, data dictionaries, or metadata reports.
๐ ๏ธ Detailed Preprocessing & Pipeline Flow
The model expects raw healthcare input data to go through the exact same workflow used during training:
- Column Alignment: Match the incoming data features with the schema saved in
column.pickle. Missing columns are imputed, and extra columns are dropped. - Feature Scaling: Since KNN relies heavily on Euclidean/Manhattan distance calculations, features must be transformed using
scale.pickle. - Classification: The scaled matrix is passed to
knn.pickleto compute nearest neighbors and return the output prediction.
๐ Step-by-Step Implementation Guide
Prerequisites
Make sure your Python environment has the following libraries installed:
pip install scikit-learn pandas numpy