Video summary

Medicine Recommendation System | Personalized Medical Recommendation System with Machine Learning

Main summary

Key takeaways

Technology

Overview

This video is a full, end-to-end tutorial (Python + Machine Learning + Flask) for building a personalized medical recommendation system. The system takes patient symptoms as input and returns:

  • A predicted disease
  • Doctor-like guidance, including:
    • Description
    • Precautions
    • Medications
    • Workout/activity advice
    • Diet recommendations

The instructor also walks through creating a Bootstrap + Flask web interface.


Core Technological Flow (What the System Does)

  1. User enters symptoms in a web form (multiple symptoms as a comma-separated text input).
  2. Symptoms are converted into a binary feature vector (one-hot style):
    • 1 = symptom present
    • 0 = symptom absent
    • Total: 133 columns132 symptom features + 1 target
  3. A trained ML model predicts the disease/prognosis using multi-class classification.
  4. The predicted disease label is mapped back to a readable disease name.
  5. The system queries a structured database (multiple CSV files) to fetch:
    • Disease description
    • Precautions
    • Medication list
    • Workout/activity suggestions
    • Diet recommendations
  6. Results are shown in the UI using Flask templates and Bootstrap modals.

ML / Data Model Details

  • Problem type: Multi-class classification (multiple possible diseases)
  • Dataset size: 4,920 records
  • Number of columns: 133
    • Target column: prognosis (encoded disease name → integers)
    • Input columns: 132 symptom features with binary values
  • Missing values: None (already preprocessed)
  • Number of classes: 41 diseases (encoded from strings)

Models Trained and Compared

The tutorial trains and evaluates multiple classifiers:

  • SVC (Support Vector Classifier)
  • Random Forest
  • Gradient Boosting
  • K-Nearest Neighbors
  • Multinomial Naive Bayes

They report 100% accuracy on the test data for the tested models and primarily select SVC afterward.

Model Persistence

  • The trained model is saved using pickle
  • The Flask backend later loads the saved model to make predictions

Web Application / UI Features

The instructor builds a Flask website with multiple pages:

  • Home (index): symptom input + “recommend” button
  • About
  • Contact
  • Developer
  • Blog

Front-End

  • Uses Bootstrap for layout and navigation
  • Displays results via Bootstrap collapsible/modals, such as:
    • Disease
    • Description
    • Precautions
    • Medication
    • Workouts
    • Diet

Project Structure

Includes:

  • data_sets/ (training + symptoms/precaution/workout/description/medication CSVs)

  • models/ (saved SVC model .pkl)

  • static/ (images such as a logo)


“Database” Design Approach (CSV-Driven Recommendations)

Instead of hardcoding recommendations, the system loads multiple CSV tables and filters them by the predicted disease.

CSV files imported include:

  • symptoms (used for mapping/label understanding)
  • description.csv
  • precaution.csv
  • medication.csv
  • workout.csv
  • diet.csv

A helper function (e.g., helper(disease)) returns:

  • Description (text)
  • Precautions (list)
  • Medication list
  • Workout list
  • Diet list

Deployment / Environment Setup Steps Mentioned

  • Create/use a virtual environment
  • Install dependencies with pip:
    • flask
    • scikit-learn (must match the notebook version used during training)
    • numpy, pandas
    • pickle (via Python standard tooling)

Flask Routes

  • / → renders index.html
  • /predict → handles form POST:
    • performs preprocessing
    • predicts disease via SVC
    • fetches recommendations
    • renders results back to the template

Speaker / Source

  • Main speaker: the tutorial’s author/host (“bamum” / channel name shown at the start of the subtitles).

Original video