-
Notifications
You must be signed in to change notification settings - Fork 0
/
Workflows.txt
45 lines (38 loc) · 1.82 KB
/
Workflows.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
START:
1. TRAINING PHASE (Done separately)
- Collect or load dataset containing symptoms and corresponding diseases
- Split data into features (symptoms) and labels (diseases)
- Preprocess data (encoding)
- Train the machine learning model on training data
- Test the model on the test data to evaluate performance
- Once satisfied, save the trained model to a file (using `joblib` or `pickle`)
- Save model to "{name of model}.pkl"(name of the best model you choose)
2. FLASK APPLICATION PHASE
- Import Flask, render_template, request
- Import the necessary library to load the ML model (`pickle`)
- Import any libraries needed for input preprocessing (e.g., `numpy`, `pandas`)
2.1 START FLASK APP
- Initialize Flask app
2.2 LOAD SAVED MODEL
- Load the previously saved ML model from the file (e.g., "model.pkl")
3. DEFINE ROUTES
3.1 HOMEPAGE ROUTE (GET)
- Create a `GET` route to display the homepage
- Render an HTML page containing a form for user input (symptoms)
3.2 PREDICTION ROUTE (POST)
- When user submits symptoms via the form:
- Extract user input from the request
- Preprocess the input data (e.g., convert symptoms to numerical format)
- Use the ML model to predict the disease based on symptoms
- Capture the model’s prediction
- Retrieve additional information based on the prediction:
- Disease Description
- Precautions
- Medications
- Recommended Workouts
- Suggested Diets
4. RETURN DETAILED INFORMATION TO USER
- Pass the disease description, precautions, medications, workouts, and diets back to the frontend
- Display all information on the webpage
5. RUN FLASK SERVER
- Start the Flask app, allowing users to interact with the web interface