Documentation

Installation Guide

SymptIQ — AI Disease Prediction Using Symptoms | Django Final Year Project

Step-by-step Setup Verified Instructions Chat Support
Back to Project
Complete Guide

Installation Guide

Follow the steps below to set up SymptIQ on your local machine. The application requires Python 3.10 or newer and pip installed on your system.

Prerequisites

  • Python 3.10 or newer
  • pip (Python package manager)
  • Jupyter Notebook (for model training via notebook)
  • A terminal or command prompt

Step 1 — Navigate to the Project Folder

After downloading or cloning the project, open your terminal and navigate to the project root directory.

cd "AI diease Prediction using Sympotm"

Step 2 — Create and Activate a Virtual Environment

It is recommended to use a virtual environment to keep dependencies isolated.

Create the environment:

python -m venv venv

Activate on macOS / Linux:

source venv/bin/activate

Activate on Windows:

venv\Scripts\activate

Step 3 — Install Dependencies

Install all required Python packages listed in the requirements file.

pip install -r requirements.txt

Step 4 — Apply Database Migrations

Run Django migrations to initialise the SQLite database and create the required tables.

python manage.py migrate

Step 5 — Create a Superuser (Optional)

To access the Django admin panel and manage prediction logs and contact messages, create an admin account.

python manage.py createsuperuser

Step 6 — Train the Machine Learning Models

The ML models must be trained before the prediction feature becomes available. Model files are saved to the ml_models/ directory.

Option A — Jupyter Notebook (Recommended)

cd training
jupyter notebook model_training.ipynb

Open the notebook and run all cells from top to bottom. The notebook will train Naive Bayes, Logistic Regression, and Random Forest classifiers, evaluate them, and export the following files to ml_models/:

  • best_model.pkl
  • symptoms_list.pkl
  • label_encoder.pkl
  • disease_info.pkl
  • training_summary.json
  • Visualisation PNG charts

Option B — Standalone Training Script

python train.py

Step 7 — Run the Development Server

Once training is complete, start the Django development server.

python manage.py runserver

Visit the application in your browser at:

http://127.0.0.1:8000

Admin Panel

Access the Django admin interface to manage prediction logs and contact messages.

http://127.0.0.1:8000/admin/

Log in with the superuser credentials you created in Step 5.

REST API Endpoints

SymptIQ exposes three JSON API endpoints for programmatic access. No authentication is required.

  • POST /api/predict/ — Submit selected symptoms and receive top disease predictions with confidence scores
  • GET /api/symptoms/?q= — Search and retrieve matching symptoms from the 377-symptom list
  • GET /api/chart-data/?type= — Fetch chart data for disease distribution, symptom frequency, model performance, and prediction trends

Production Deployment

To deploy SymptIQ on a production server, follow these additional steps.

python manage.py collectstatic
export SECRET_KEY="your-secure-secret-key"
export DEBUG=False
export ALLOWED_HOSTS="yourdomain.com"
pip install gunicorn
gunicorn symptiq.wsgi:application --bind 0.0.0.0:8000

Note: If the ML model files are missing from the ml_models/ directory, the Predict page will display a warning and the Analyse button will be disabled. Always complete Step 6 before running the server.

Need Help?

Our team is here to assist you with installation and setup.

Chat with Us
Chat with us