How spider-loki/ml-model-lab works
ML Model Lab is a small web application for house-price regression and Titanic survival classification. Users open either prediction form, submit feature values through the React UI, and receive predictions plus model metrics (and a plot for house prices). The API dispatches requests to separately trained model modules; the dataset files are inputs to those models. The sampled code shows the house and Titanic paths, but Disform uses an endpoint not present in the sampled API, so that connection is not included. Data-loading paths and some deployment details are environment-specific.
Main entry points: main.py FastAPI routes · App.jsx App shell · Linform.jsx House form · Logform.jsx Titanic form
Components 12
Frontend
- App shell
frontend/src/App.jsx - Welcome title
frontend/src/Title.jsx - House form
frontend/src/Linform.jsx - Titanic form
frontend/src/Logform.jsx - Alternate form
frontend/src/Disform.jsx
API
- FastAPI routes
backend/main.py
Prediction models
- House regression
backend/ML_models/Linear_reg.py - Titanic classifier
backend/ML_models/Logistic_reg.py
Datasets
- House prices
backend/dataset/house_prices.csv - Titanic data
backend/dataset/Titanic-Dataset.csv - Tested dataset
backend/dataset/tested.csv
Other components
- User
Connections 13
- User → App shell: uses
frontend/src/App.jsx - App shell → Welcome title: renders
frontend/src/App.jsx - App shell → House form: renders
frontend/src/App.jsx - App shell → Titanic form: renders
frontend/src/App.jsx - App shell → Alternate form: renders
frontend/src/App.jsx - House form → FastAPI routes: POST prediction
frontend/src/Linform.jsx - FastAPI routes → House form: returns result
backend/main.py - FastAPI routes → House regression: calls prediction
backend/main.py - Titanic form → FastAPI routes: POST prediction
frontend/src/Logform.jsx - FastAPI routes → Titanic form: returns result
backend/main.py - FastAPI routes → Titanic classifier: calls prediction
backend/main.py - House regression → House prices: loads
- Titanic classifier → Titanic data: loads