Skip to content

saeidmoghbel/simple-ML-model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple ML Model

Two machine learning scripts exploring different levels of model complexity — from a minimal regression baseline to a neural network with model monitoring.

Scripts

  • main-sklearn.py — Linear regression with scikit-learn on synthetic data
  • main-2.py — MLP classifier with PyTorch on the Titanic dataset, including Evidently AI monitoring and Prometheus metrics

main-2.py — Titanic Survival Prediction

Dataset

The Titanic dataset is loaded automatically from a public URL. No local file needed.

Features used: Pclass, Sex, Age, SibSp, Parch, Fare, Embarked
Target: Survived (0 = No, 1 = Yes)

Model Architecture

A 3-layer MLP built with PyTorch:

  • Loss: CrossEntropyLoss
  • Optimizer: SGD (lr=0.01)
  • Epochs: 1000
  • Split: 80% train / 20% test

Monitoring

After training, the script generates:

  • model_monitoring_report.html — Evidently AI report (Data Drift, Target Drift, Classification metrics)
  • Prometheus metrics exposed at http://localhost:8000

How to Run

pip install torch pandas scikit-learn evidently prometheus-client

# Minimal linear regression
python main-sklearn.py

# Titanic MLP + monitoring
python main-2.py

Tech Stack

Python · PyTorch · scikit-learn · pandas · Evidently AI · Prometheus

About

Supervised ML pipeline with feature engineering, training & evaluation using scikit-learn

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages