Medical Symptom Analyzer
This project is a Flask-based web application that uses machine learning to predict possible diseases based on a set of symptoms selected by the user. By combining multiple algorithms and a structured training dataset, the system delivers quick and consistent predictions, simulating a "multi-expert panel" that analyzes the input and suggests the most probable diagnosis.
How it works
-
Data management – The application connects to a local SQLite database that stores historical training data. This data includes multiple symptoms and their associated diagnoses, forming the basis for model training.
-
Data preprocessing – With pandas and NumPy, the data is cleaned, normalized, and transformed. Using LabelEncoder, disease names are converted into numerical labels so the models can interpret them.
-
Model training – Three different algorithms are trained on the dataset:
-
Support Vector Machine (SVM) – Finds the best boundaries to separate diseases based on symptoms.
-
Naive Bayes – Uses probability to suggest the most likely disease.
-
Random Forest – Combines the decisions of multiple trees to provide a robust prediction.
-
-
Prediction engine – When a user selects symptoms, the app converts those into a numeric input vector. Each model gives its prediction, and the system uses the mode (majority vote) to decide the final diagnosis.
-
User interface – Built with Flask templates and AJAX, the app provides a responsive experience where users can search symptoms dynamically and get immediate results.
Applications
While this project focuses on health, the architecture can be applied to many industries where symptoms (signals) lead to a diagnosis (classification):
-
IT Support: Error messages and performance metrics could predict system failures.
-
Automotive: Vehicle noises and alerts could suggest likely mechanical issues.
-
Quality Control: Defect patterns in manufacturing could help detect faulty batches early.
-
Fraud Detection: Unusual transaction behaviors could be flagged automatically for review.
Technologies used
-
Backend: Flask, SQLite
-
Data processing: pandas, NumPy, LabelEncoder
-
Machine Learning: SVM, Naive Bayes, Random Forest (scikit-learn)
-
Frontend: HTML, AJAX, JavaScript
Business value
This system demonstrates how machine learning and automation can deliver fast, consistent, and scalable insights. For organizations, similar implementations can:
-
Improve decision-making speed and accuracy.
-
Reduce repetitive manual analysis.
-
Scale expertise to serve multiple users simultaneously.
-
Continuously improve as more data is added to the training set.