PolyDisease Predictor is a Streamlit web application that uses machine learning models to predict various diseases, including diabetes, heart disease, and multiple diseases based on user-provided symptoms and health parameters. The application also incorporates user feedback to improve prediction accuracy
Prerequisites:
- Python 3.6+
- Anaconda or Miniconda (recommended)
- MySQL Server (if you intend to use the database features)
Setup:
-
Clone the Repository:
git clone https://github.com/Sudhanshu-Ambastha/Poly-Disease-Predictor.git cd Poly-Disease-Predictor
-
Create a Virtual Environment (Recommended):
conda create -n polydisease python=3.9 conda activate polydisease
-
Install Dependencies:
pip install -r Streamlit_app/requirements.txt
to save dependencies:
pip freeze > requirements.txt
-
Database Setup (Optional):
-
Ensure your MySQL server is running.
-
Create a
.streamlit/secrets.toml
file in your project directory. This file should contain your database credentials. See the providedtomlStruct.txt
for the expected structure. Example:[mysql] host = "your_host" user = "your_user" password = "your_password" port = your_port
Connecting to FreeSQLDatabase (Optional):
If you prefer to use a free online MySQL database, you can use FreeSQLDatabase. Here's how to connect:
-
Sign up for a free account at FreeSQLDatabase.
-
Once you've created a database, you'll receive your connection details (server address, port, database name, username, and password) at mail.
-
Update your
.streamlit/secrets.toml
file with these credentials:host = "your_freesqldatabase_host" # e.g., "sql12.freesqldatabase.com" user = "your_freesqldatabase_user" password = "your_freesqldatabase_password" port = your_freesqldatabase_port # Usually 3306 database = "your_freesqldatabase_name"
-
-
Run the Application:
streamlit run Streamlit_app/app.py
-
Access the Application:
Open your web browser and navigate to the URL provided in the terminal (usually
http://localhost:8501
).
Open your web browser and navigate to the provided URL (usually http://localhost:8501).
- Multiple Disease Prediction: Predicts potential diseases based on a comma-separated list of symptoms. Allows user feedback (correct/incorrect) to improve the model. Dynamically adds new symptoms to the database.
- Diabetes Prediction: Predicts the likelihood of diabetes based on health parameters (pregnancies, glucose, blood pressure, etc.). Collects user feedback.
- Heart Disease Prediction: Predicts the likelihood of heart disease based on cardiovascular health parameters. Collects user feedback.
- Select the desired predictor tab from the sidebar.
- Enter the required information (symptoms, health parameters).
- Click the "Predict" or "Test Result" button.
- Provide feedback on the prediction to help improve the model.
- Diabetes dataset: Kaggle Diabetes Dataset
- Heart disease dataset: Kaggle Heart Disease Dataset
- Multiple disease dataset: Custom dataset used for training and testing.
- File Paths: The application uses relative file paths. Ensure the
models
directory and.sql
files are in the correct locations relative to theapp.py
file. - Database Connection: If you intend to use the feedback features, ensure your MySQL database is set up correctly and the credentials are in the
.streamlit/secrets.toml
file. - Model Files: The application relies on pre-trained machine learning models (
.sav
files) located in themodels
directory. Ensure these files are present. - Dependencies: All required Python packages are listed in
Streamlit_app/requirements.txt
.
Update: This project was created to address challenges faced in earlier models, making it easy to run directly via VS Code, especially when opened through GitHub Desktop. With the presence of necessary files, the project can now be executed seamlessly.
Please checkout the deployed working model here Poly Disease Predictor & Backend deployed at Free SQL Database
Feel free to contribute and enhance the application!
For contributors looking to integrate a MySQL backend, please refer to the tomlStruct.txt
file for the expected structure of the TOML configuration file required for database connection details
Sudhanshu Ambastha |
Parth Shrivastava |
Shrivatsa Sharan Garg |