A simple machine learning project with end-to-end MLOps use case: from raw data and move through data preprocessing, feature engineering, experimentation, model tracking with MLflow, and optionally using Jupyter for exploration.
-
Setup Python Virtual Environment using UV:
uv venv --python python3.11 source .venv/bin/activate -
Install dependencies:
uv pip install -r requirements.txt
To track experiments and model runs:
docker-compose -f deployment/mlflow/docker-compose.yml up -d
docker-compose psUsing Podman? Use this instead:
podman-compose -f deployment/mlflow/docker-compose.yaml up -d
podman-compose psAccess the MLflow UI at http://localhost:5555
If you prefer an interactive experience, launch JupyterLab with:
uv python -m jupyterlab
# or
python -m jupyterlabClean and preprocess the raw housing dataset:
python src/data/run_processing.py --input data/raw/house_data.csv --output data/processed/cleaned_house_data.csvApply transformations and generate features:
python src/features/engineer.py --input data/processed/cleaned_house_data.csv --output data/processed/featured_house_data.csv --preprocessor models/trained/preprocessor.pklTrain your model and log everything to MLflow:
python src/models/train_model.py --config configs/model_config.yaml --data data/processed/featured_house_data.csv --models-dir models --mlflow-tracking-uri http://localhost:5555To build and run the FastAPI that the streamlit app will use, run:
podman build -t house-price-predict-fastapi:latest . # Build the image
podman run -idtp house-price-predict-fastapi # Run the containerYou could test the API with Postman, or using curl using:
curl -X POST "http://localhost:8000/predict" \
-H "Content-Type: application/json" \
-d '{
"sqft": 1500,
"bedrooms": 3,
"bathrooms": 2,
"location": "suburban",
"year_built": 2000,
"condition": "fair"
}'NOTE: Be sure to replace http://localhost:8000/predict with actual endpoint based on where its running.
To run the streamlit app with FastAPI, run:
podman-compose build # Build the image
podman-compose up -d # Run the streamlit app with Fastapi