Add model card README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
---
|
| 3 |
+
tags:
|
| 4 |
+
- sklearn
|
| 5 |
+
- random-forest
|
| 6 |
+
- classification
|
| 7 |
+
- predictive-maintenance
|
| 8 |
+
- engine-health
|
| 9 |
+
---
|
| 10 |
+
# Engine Predictive Maintenance Model
|
| 11 |
+
|
| 12 |
+
This repository hosts a Random Forest Classifier model for predicting engine condition (Normal/Faulty) based on sensor readings.
|
| 13 |
+
|
| 14 |
+
## Model Description
|
| 15 |
+
|
| 16 |
+
The model is a `RandomForestClassifier` trained on engine sensor data to identify potential failures. It was selected as the best-performing model due to its high recall score, which is critical for minimizing false negatives in predictive maintenance scenarios.
|
| 17 |
+
|
| 18 |
+
## Training Details
|
| 19 |
+
|
| 20 |
+
- **Model Type**: Random Forest Classifier
|
| 21 |
+
- **Objective**: Binary Classification (0: Normal, 1: Faulty)
|
| 22 |
+
- **Training Data**: Preprocessed engine sensor data (features: engine_rpm, lub_oil_pressure, fuel_pressure, coolant_pressure, lub_oil_temp, coolant_temp, pressure_ratio, temp_diff; target: engine_condition).
|
| 23 |
+
- **Key Hyperparameters (tuned)**:
|
| 24 |
+
- `n_estimators`: 50
|
| 25 |
+
- `max_depth`: 5
|
| 26 |
+
- `min_samples_split`: 5
|
| 27 |
+
- `min_samples_leaf`: 1
|
| 28 |
+
|
| 29 |
+
## Evaluation Metrics (on Test Set)
|
| 30 |
+
|
| 31 |
+
- **Accuracy**: 0.6601
|
| 32 |
+
- **Precision**: 0.6652
|
| 33 |
+
- **Recall**: 0.9277 (Prioritized metric)
|
| 34 |
+
- **F1-Score**: 0.7748
|
| 35 |
+
|
| 36 |
+
## How to Use
|
| 37 |
+
|
| 38 |
+
To load and use this model for inference:
|
| 39 |
+
|
| 40 |
+
```python
|
| 41 |
+
from huggingface_hub import hf_hub_download
|
| 42 |
+
import joblib
|
| 43 |
+
import pandas as pd
|
| 44 |
+
|
| 45 |
+
model_path = hf_hub_download(repo_id="SharleyK/engine-predictive-maintenance-model", filename="random_forest_model.pkl")
|
| 46 |
+
model = joblib.load(model_path)
|
| 47 |
+
|
| 48 |
+
# Example inference (replace with your actual data)
|
| 49 |
+
# Make sure your input data has the same features and preprocessing steps as training
|
| 50 |
+
example_data = pd.DataFrame([{
|
| 51 |
+
'engine_rpm': 700.0, 'lub_oil_pressure': 2.5, 'fuel_pressure': 11.8, 'coolant_pressure': 3.2,
|
| 52 |
+
'lub_oil_temp': 80.0, 'coolant_temp': 82.0, 'pressure_ratio': 0.78, 'temp_diff': -2.0
|
| 53 |
+
}])
|
| 54 |
+
|
| 55 |
+
prediction = model.predict(example_data)
|
| 56 |
+
print(f"Predicted Engine Condition: {prediction[0]} (0=Normal, 1=Faulty)")
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
## License
|
| 60 |
+
|
| 61 |
+
[Specify license, e.g., MIT, Apache 2.0]
|