Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,8 +8,8 @@ model = joblib.load("predictive_maintenance_model(1).pkl")
|
|
| 8 |
model = joblib.load(model_path)
|
| 9 |
|
| 10 |
# Define the prediction function
|
| 11 |
-
def predict_maintenance(feature1, feature2, feature3, feature4):
|
| 12 |
-
input_data = np.array([[feature1, feature2, feature3, feature4]]) # Modify according to your dataset
|
| 13 |
prediction = model.predict(input_data)
|
| 14 |
return f"Predicted Maintenance Requirement: {prediction[0]}"
|
| 15 |
|
|
@@ -21,6 +21,16 @@ interface = gr.Interface(
|
|
| 21 |
gr.Number(label="Feature 2"),
|
| 22 |
gr.Number(label="Feature 3"),
|
| 23 |
gr.Number(label="Feature 4"),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
],
|
| 25 |
outputs=gr.Textbox(label="Prediction"),
|
| 26 |
title="Predictive Maintenance for Industrial Equipment",
|
|
|
|
| 8 |
model = joblib.load(model_path)
|
| 9 |
|
| 10 |
# Define the prediction function
|
| 11 |
+
def predict_maintenance(feature1, feature2, feature3, feature4,feature5,feature6,feature7,feature8,feature9,feature10):
|
| 12 |
+
input_data = np.array([[feature1, feature2, feature3, feature4,feature5,feature6,feature7,feature8,feature9,feature10]]) # Modify according to your dataset
|
| 13 |
prediction = model.predict(input_data)
|
| 14 |
return f"Predicted Maintenance Requirement: {prediction[0]}"
|
| 15 |
|
|
|
|
| 21 |
gr.Number(label="Feature 2"),
|
| 22 |
gr.Number(label="Feature 3"),
|
| 23 |
gr.Number(label="Feature 4"),
|
| 24 |
+
gr.Number(label="Feature 5"),
|
| 25 |
+
gr.Number(label="Feature 6"),
|
| 26 |
+
gr.Number(label="Feature 7"),
|
| 27 |
+
gr.Number(label="Feature 8"),
|
| 28 |
+
gr.Number(label="Feature 9"),
|
| 29 |
+
gr.Number(label="Feature 10"),
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
],
|
| 35 |
outputs=gr.Textbox(label="Prediction"),
|
| 36 |
title="Predictive Maintenance for Industrial Equipment",
|