File size: 970 Bytes
cec404d
 
 
 
 
 
e2fd99e
cec404d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
import pandas as pd
import numpy as np
import joblib

# Load the trained model
model = joblib.load("Predictive_Maintenance_for_Industrial_Equipment (1).pynb")

# Define the prediction function
def predict_maintenance(feature1, feature2, feature3, feature4):
    input_data = np.array([[feature1, feature2, feature3, feature4]])  # Modify according to your dataset
    prediction = model.predict(input_data)
    return f"Predicted Maintenance Requirement: {prediction[0]}"

# Create the Gradio interface
interface = gr.Interface(
    fn=predict_maintenance,
    inputs=[
        gr.Number(label="Feature 1"),
        gr.Number(label="Feature 2"),
        gr.Number(label="Feature 3"),
        gr.Number(label="Feature 4"),
    ],
    outputs=gr.Textbox(label="Prediction"),
    title="Predictive Maintenance for Industrial Equipment",
    description="Enter sensor readings to predict maintenance requirements."
)

# Launch the app
interface.launch()