How mohamedsathikz/salary_prediction_mlops works
This repository trains a salary regression model and serves predictions through a FastAPI endpoint. The main workflow reads the salary dataset, fits and evaluates a linear regression model, saves it for the API to load, then turns submitted experience into a predicted salary. Training also records parameters, metrics, and a model artifact with MLflow. The graph follows the sampled training and API code; it does not infer additional behavior from the tracked MLflow files.
Main entry points: train.py Fit and evaluate · app.py FastAPI routes · salary_model.joblib Saved model · Salary_dataset.csv Salary dataset
Components 11
Model training
- Salary dataset
Salary_dataset.csv - Prepare data
train.py - Fit and evaluate
train.py - Saved model
models/salary_model.joblib
Prediction API
- FastAPI routes
app.py - Prediction
app.py - Salary result
Experiment tracking
- MLflow metadata
mlflow.db - MLflow artifacts
mlruns
Other components
- Model operator
- API client
Connections 10
- Model operator → Prepare data: runs training
train.py - Prepare data → Salary dataset: reads
train.py - Prepare data → Fit and evaluate: provides data
train.py - Fit and evaluate → Saved model: saves model
train.py - Fit and evaluate → MLflow metadata: logs metrics
train.py - Fit and evaluate → MLflow artifacts: logs artifact
train.py - API client → FastAPI routes: submits request
app.py - FastAPI routes → Saved model: loads model
app.py - FastAPI routes → Prediction: dispatches
app.py - Prediction → Salary result: returns salary
app.py