How mhmdamash/iubh-project-from-model-to-production works
This project generates synthetic factory readings, trains and saves an Isolation Forest pipeline, then serves anomaly scores through a Flask API. Its principal live workflow is the simulator generating readings, sending them to the API, and printing an alert when the response flags an anomaly. The API loads the model at startup and logs predictions; a health endpoint supports uptime checks. The graph follows README capabilities and sampled source; the generated data, model, and log are runtime artifacts, not files in the supplied tree.
Main entry points: app.py Flask prediction API · stream_simulator.py Stream simulator · create_model.py Model trainer · generate_data.py Synthetic data generator
Components 10
Data and training
- Synthetic data generator
generate_data.py - Sensor dataset
- Model trainer
create_model.py - Trained pipeline
Prediction service
- Flask prediction API
app.py - Prediction log
Live stream
- Stream simulator
stream_simulator.py
Other components
- API client
- Uptime monitor
- Alert recipient
Connections 10
- Synthetic data generator → Sensor dataset: writes data
- Model trainer → Sensor dataset: reads data
- Model trainer → Trained pipeline: saves pipeline
- Flask prediction API → Trained pipeline: loads at startup
- API client → Flask prediction API: requests prediction
- Stream simulator → Flask prediction API: posts readings
- Flask prediction API → Stream simulator: returns scores
- Flask prediction API → Prediction log: writes predictions
- Uptime monitor → Flask prediction API: checks health
- Stream simulator → Alert recipient: prints alerts