CoolFace
Modelpublic

amirsoahil101/Heart_stroke_prediction

sourceHugging Facemitupdated 3mo agoView on Hugging Face
0likes
Model Card

๐Ÿฅ 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:

  1. 1.`knn.pickle`: The main trained K-Nearest Neighbors classifier model instance.
  2. 2.`scale.pickle`: A trained StandardScaler (or MinMaxScaler) used to normalize patient features, preventing distance-distortion in KNN.
  3. 3.`column.pickle`: A serialized Python list containing the precise order of feature columns required by the model.
  4. 4.`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:

  1. 1.Column Alignment: Match the incoming data features with the schema saved in column.pickle. Missing columns are imputed, and extra columns are dropped.
  2. 2.Feature Scaling: Since KNN relies heavily on Euclidean/Manhattan distance calculations, features must be transformed using scale.pickle.
  3. 3.Classification: The scaled matrix is passed to knn.pickle to compute nearest neighbors and return the output prediction.

๐Ÿš€ Step-by-Step Implementation Guide

Prerequisites

Make sure your Python environment has the following libraries installed:

bash
pip install scikit-learn pandas numpy