Idriss Lemnouni Get in touch
All projects

Machine learning / Data engineering

Serving and monitoring a soil-moisture model

How can a local prediction service catch invalid inputs and spot changes in incoming data?

Solution

I tracked the model in MLflow, checked inputs in FastAPI and stored accepted requests in SQLite so I could monitor feature drift.

My contribution · I packaged an existing model, built schema validation and audit logging, and compared replayed inputs with the training distributions.

Tools Python · FastAPI · MLflow · SQLite

Results

The API accepted 40 requests in a historical replay.

The monitor compared incoming features against their training distributions.

Historical requests replayed
40 Source

Data & evaluation

Data sources

  • NOAA US Climate Reference Network daily records from three stations, 2016–2024

Method

  1. Track the selected forest in MLflow, bind it to a checksum and validate each incoming request against the release schema.
  2. Write accepted inputs and predictions to SQLite. Compare incoming feature distributions with training-only bins and suppress scores for insufficient samples.

Limitations

The inputs came from a historical replay. Drift flags measure input changes and need observed labels to establish model degradation.

Production reliability and live prediction quality require sustained workload measurements and independently observed outcomes.

Reproduce the study

Use Python 3.12 and the locked requirements. Prepare the documented model release and data, start the local API, then replay the inputs and inspect monitoring.

Local reproduction instructions and pinned source

Skills demonstrated

  • Model serving
  • Input validation
  • Feature drift monitoring

Project figures