File size: 2,007 Bytes
d53c9b7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

---
tags:
- sklearn
- random-forest
- classification
- predictive-maintenance
- engine-health
---
# Engine Predictive Maintenance Model

This repository hosts a Random Forest Classifier model for predicting engine condition (Normal/Faulty) based on sensor readings.

## Model Description

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.

## Training Details

- **Model Type**: Random Forest Classifier
- **Objective**: Binary Classification (0: Normal, 1: Faulty)
- **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).
- **Key Hyperparameters (tuned)**:
  - `n_estimators`: 50
  - `max_depth`: 5
  - `min_samples_split`: 5
  - `min_samples_leaf`: 1

## Evaluation Metrics (on Test Set)

- **Accuracy**: 0.6601
- **Precision**: 0.6652
- **Recall**: 0.9277 (Prioritized metric)
- **F1-Score**: 0.7748

## How to Use

To load and use this model for inference:

```python
from huggingface_hub import hf_hub_download
import joblib
import pandas as pd

model_path = hf_hub_download(repo_id="SharleyK/engine-predictive-maintenance-model", filename="random_forest_model.pkl")
model = joblib.load(model_path)

# Example inference (replace with your actual data)
# Make sure your input data has the same features and preprocessing steps as training
example_data = pd.DataFrame([{
    'engine_rpm': 700.0, 'lub_oil_pressure': 2.5, 'fuel_pressure': 11.8, 'coolant_pressure': 3.2,
    'lub_oil_temp': 80.0, 'coolant_temp': 82.0, 'pressure_ratio': 0.78, 'temp_diff': -2.0
}])

prediction = model.predict(example_data)
print(f"Predicted Engine Condition: {prediction[0]} (0=Normal, 1=Faulty)")
```

## License

[Specify license, e.g., MIT, Apache 2.0]