Tabular Classification
Scikit-learn
Joblib
ONNX
English
healthcare
medical
disease-prediction
ensemble
scikit-learn
Eval Results (legacy)
Instructions to use Av1447/Health with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use Av1447/Health with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("Av1447/Health", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
|
Download README.md from Av1447/Health: direct link, hf CLI and curl.
- Browser
- Download file 3.78 kB
-
https://huggingface.co/Av1447/Health/resolve/main/README.md
- Command line
-
hf download hf://Av1447/Health/README.md
-
curl -L -o README.md https://huggingface.co/Av1447/Health/resolve/main/README.md
3.78 kB
| language: | |
| - en | |
| license: mit | |
| library_name: sklearn | |
| tags: | |
| - tabular-classification | |
| - healthcare | |
| - medical | |
| - disease-prediction | |
| - ensemble | |
| - scikit-learn | |
| metrics: | |
| - accuracy | |
| model-index: | |
| - name: AI-Driven Healthcare Disease Prediction Ensemble | |
| results: | |
| - task: | |
| type: tabular-classification | |
| name: Disease Classification | |
| metrics: | |
| - type: accuracy | |
| value: 0.1333 | |
| name: Test Accuracy | |
| # ๐ฉบ AI-Driven Healthcare Disease Prediction Ensemble | |
| A multi-model ensemble classifier built with **Scikit-Learn** combining **Random Forest**, **Support Vector Machines (RBF Kernel)**, and **Gaussian Naive Bayes** to predict clinical pathologies from patient symptom indicators. | |
| ## ๐ Model Details | |
| - **Architecture**: `VotingClassifier` with soft probability voting | |
| - **Sub-Estimators**: | |
| - `RandomForestClassifier` (100 estimators, Gini criterion) โ Weight: `0.40` | |
| - `SVC` (Radial Basis Function Kernel, probability=True) โ Weight: `0.35` | |
| - `GaussianNB` (Multinomial Prior Likelihood) โ Weight: `0.25` | |
| - **Number of Symptom Features**: 180 binary indicators (0 = absent, 1 = present) | |
| - **Number of Disease Classes**: 10 target pathologies | |
| - **Test Accuracy**: **13.33%** on independent clinical testing cohort | |
| --- | |
| ## ๐ฆ Files in this Repository | |
| | File | Description | | |
| | :--- | :--- | | |
| | **`model.joblib`** | The complete trained `VotingClassifier` ensemble pipeline. | | |
| | **`symptoms.json`** | Array of 180 symptom feature names in exact column sequence. | | |
| | **`diseases.json`** | List of all 10 prognostic disease labels. | | |
| | **`prescriptions.json`** | Clinical treatment and prescription mapping for predicted pathologies. | | |
| --- | |
| ## ๐ป Quickstart Inference (Python) | |
| ```python | |
| import joblib | |
| import json | |
| import numpy as np | |
| import pandas as pd | |
| from huggingface_hub import hf_hub_download | |
| # 1. Download model and feature list from Hugging Face | |
| REPO_ID = "YOUR_USERNAME/YOUR_MODEL_NAME" # e.g., "Av1447/disease-prediction-ensemble" | |
| model_path = hf_hub_download(repo_id=REPO_ID, filename="model.joblib") | |
| symptoms_path = hf_hub_download(repo_id=REPO_ID, filename="symptoms.json") | |
| model = joblib.load(model_path) | |
| with open(symptoms_path, "r") as f: | |
| symptom_features = json.load(f) | |
| # 2. Build input vector for patient symptoms | |
| # Example: Patient has Headache and Sensitivity to Light | |
| patient_symptoms = ["Headache", "Sensitivity to Light", "Sensitivity to Sound"] | |
| # Binary vector (1 if symptom is present, 0 otherwise) | |
| input_vector = [1 if feature in patient_symptoms else 0 for feature in symptom_features] | |
| input_df = pd.DataFrame([input_vector], columns=symptom_features) | |
| # 3. Predict disease and probability | |
| probabilities = model.predict_proba(input_df)[0] | |
| top_idx = probabilities.argmax() | |
| predicted_disease = model.classes_[top_idx] | |
| confidence = probabilities[top_idx] * 100 | |
| print(f"Predicted Diagnosis: {predicted_disease} ({confidence:.1f}% confidence)") | |
| ``` | |
| --- | |
| ## ๐ Serverless Inference API / Web Usage | |
| You can query this model directly via Hugging Face Serverless Inference API or via client-side web applications hosted on Vercel or GitHub Pages. | |
| ```javascript | |
| // Example JavaScript fetch from your frontend | |
| const response = await fetch( | |
| "https://api-inference.huggingface.co/models/YOUR_USERNAME/YOUR_MODEL_NAME", | |
| { | |
| headers: { | |
| Authorization: "Bearer hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", | |
| "Content-Type": "application/json", | |
| }, | |
| method: "POST", | |
| body: JSON.stringify({ inputs: [inputVector] }), | |
| } | |
| ); | |
| const result = await response.json(); | |
| ``` | |
| --- | |
| ## โ๏ธ Intended Use & Disclaimer | |
| This model is developed for research, education, triage assistance, and prototyping. It is not intended to replace professional medical diagnosis, laboratory testing, or clinical consultation. | |