INSY 4325 — Group 12
Double-click run.bat
chmod +x run.sh
./run.shThen open http://localhost:5050 in your browser.
| Username | Password | Role |
|---|---|---|
| admin | admin123 | Admin |
| analyst | analyst123 | Data Analyst |
| engineer | engineer123 | Maintenance Engineer |
- Go to Clean Data in the sidebar
- Upload
sample_data.csv(included) or your own CSV - Select cleaning options and click Import & Clean
Expected CSV columns:
Type, Air temperature [K], Process temperature [K],
Rotational speed [rpm], Torque [Nm], Tool wear [min], Machine failure
- Click Test & Score All Algorithms
- Compare AUC, F1, Precision, Recall across 4 algorithms
- Click Use this on your preferred algorithm
- Click Train Model to fit on the full cleaned dataset
- The trained model is saved to the SQLite database
- Click Deploy to activate the model for predictions
- Enter live sensor readings
- Click Predict to get a risk classification:
- 🔴 HIGH (≥70%) — immediate action required
- 🟡 MEDIUM (40–69%) — inspect within 72 hours
- 🟢 LOW (<40%) — continue normal operations
- Every prediction is automatically logged to the database
mfp_analyzer/
├── app.py Flask application & all routes
├── ml_engine.py ML pipeline (cleaning, training, prediction)
├── generate_sample_data.py Synthetic dataset generator
├── sample_data.csv Ready-to-use sample dataset (2000 rows)
├── requirements.txt
├── run.bat Windows launcher
├── run.sh Mac/Linux launcher
├── database/
│ └── db.py SQLite schema, seed users, helpers
└── templates/
├── base.html Sidebar layout & dark theme
├── login.html
├── dashboard.html
├── clean.html
├── algorithm.html
├── train.html
├── predict.html
└── history.html
| Table | Key Fields |
|---|---|
users |
user_id, username, password (hashed), role |
datasets |
dataset_id, file_name, row_count, feature_count |
cleaning_configs |
config_id, dataset_id, all cleaning option flags |
training_sessions |
session_id, dataset_id, algorithm, k_folds |
ml_models |
model_id, session_id, metrics, is_deployed, blob |
prediction_records |
prediction_id, model_id, timestamp, risk_class, all inputs |
| Algorithm | Strength |
|---|---|
| Logistic Regression | Fast, interpretable, strong AUC |
| Naive Bayes | Works well with small datasets |
| Decision Tree | Highly interpretable |
| KNN | Good non-parametric baseline |
Evaluation uses Stratified K-Fold Cross-Validation (default k=5).
- Python 3.10+
- flask, scikit-learn, pandas, numpy
Install manually: pip install -r requirements.txt