🩺 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)

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.

// 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.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Evaluation results