You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-3Lines changed: 18 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,9 +118,24 @@ Once the environment is set up and dependencies are installed (using either `uv`
118
118
pytest -v
119
119
```
120
120
121
+
2. **Train the Machine Learning Pipeline:**
122
+
This step will load `data/data.csv`, preprocess it, train the Random Forest classifier within a `scikit-learn` pipeline, evaluate it, and then save the complete trained pipeline to `models/model.joblib`. Ensure your virtual environment is activated and `data/data.csv` is present, then run:
123
+
```powershell
124
+
python -m src.model.model_training
125
+
```
126
+
This will train the pipeline and save it as `models/model.joblib`.
127
+
128
+
3. **Run the Flask API locally:**
129
+
Ensure your virtual environment is activated and the model pipeline is trained (`models/model.joblib` exists), then run:
130
+
```bash
131
+
python -m src.app
132
+
```
133
+
The API will be accessible at `http://127.0.0.1:5000/`. Keep this running in one terminal.
134
+
135
+
121
136
## API usage examples
122
137
123
-
With the Flask API running locally (as described in step 6 under "Setup and Run"), you can test its endpoints:
138
+
With the Flask API running locally (as described in the 'Run the Flask API locally' step under 'Running tests'), you can test its endpoints:
124
139
125
140
### 1. Health check (`GET /`)
126
141
@@ -159,7 +174,7 @@ With the Flask API running locally (as described in step 6 under "Setup and Run"
159
174
& ".\tests\integration\powershell_test.ps1"
160
175
```
161
176
162
-
(Ensure the Flask API is running locally as described in step 6 under "Setup and Run" before running these scripts.)
177
+
(Ensure the Flask API is running locally as described in the 'Run the Flask API locally' step under 'Running tests' before running these scripts.)
163
178
164
179
**Expected Output:**
165
180
```json
@@ -176,7 +191,7 @@ With the Flask API running locally (as described in step 6 under "Setup and Run"
176
191
The Streamlit application (`src/streamlit_app.py`) provides an interactive web interface for making predictions using the Flask API.
177
192
178
193
1. **Run the Streamlit application locally:**
179
-
Ensure your virtual environment is activated and the Flask API is running (as described instep 6 under "Setup and Run"), then run:
194
+
Ensure your virtual environment is activated and the Flask API is running (as described inthe 'Run the Flask API locally' step under 'Running tests'), then run:
0 commit comments