Instructions to use ThabangTheActuaryCoder/mining-equipment-failure-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use ThabangTheActuaryCoder/mining-equipment-failure-model with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("ThabangTheActuaryCoder/mining-equipment-failure-model", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
| library_name: sklearn | |
| tags: | |
| - tabular-classification | |
| - sklearn | |
| - equipment-failure | |
| - mining | |
| - south-africa | |
| # Mining Equipment Failure Prediction Model | |
| A **GradientBoostingClassifier** pipeline for predicting equipment failures, | |
| trained on South African mining data. | |
| ## Intended Use | |
| This model is intended for **educational and demonstration purposes** as part of | |
| an end-to-end ML pipeline showcasing Databricks, MLflow, Azure ML, and | |
| Hugging Face Hub integration. | |
| ## Model Details | |
| | Property | Value | | |
| |---|---| | |
| | Classifier | `GradientBoostingClassifier` | | |
| | Pipeline steps | preprocessor -> classifier | | |
| | Training samples | 12,000 | | |
| | Test samples | 3,000 | | |
| | Target column | `target` | | |
| | Created | 2026-06-16T15:38:07.336452+00:00 | | |
| ## Evaluation Metrics | |
| | Metric | Score | | |
| |---|---| | |
| | Accuracy | 0.9337 | | |
| | Precision | 0.7510 | | |
| | Recall | 0.5884 | | |
| | F1 | 0.6598 | | |
| | ROC AUC | 0.9465 | | |
| ### Confusion Matrix | |
|  | |
| ### ROC Curve | |
|  | |
| ### Feature Importance | |
|  | |
| ## Features | |
| **Numeric:** `temperature_celsius`, `vibration_mm_s`, `oil_pressure_kpa`, `rpm`, `operating_hours`, `days_since_maintenance`, `load_percentage`, `ambient_temperature_celsius`, `hydraulic_pressure_kpa`, `num_previous_failures` | |
| **Categorical:** `equipment_type`, `mine_type`, `shift`, `province` | |
| ## Sample Usage | |
| ```python | |
| import joblib | |
| from huggingface_hub import hf_hub_download | |
| import pandas as pd | |
| # Download and load the model | |
| model_path = hf_hub_download( | |
| repo_id="ThabangTheActuaryCoder/mining-equipment-failure-model", | |
| filename="equipment_failure_model.joblib", | |
| ) | |
| model = joblib.load(model_path) | |
| # Create a sample input | |
| sample = pd.DataFrame([{"temperature_celsius": 0, "vibration_mm_s": 0, "oil_pressure_kpa": 0, "rpm": 0, "operating_hours": 0, "days_since_maintenance": 0, "load_percentage": 0, "ambient_temperature_celsius": 0, "hydraulic_pressure_kpa": 0, "num_previous_failures": 0, "equipment_type": 0, "mine_type": 0, "shift": 0, "province": 0}]) | |
| # Predict | |
| prediction = model.predict(sample) | |
| probabilities = model.predict_proba(sample) | |
| print(f"Prediction: {prediction}, Probabilities: {probabilities}") | |
| ``` | |