File size: 1,246 Bytes
f818107
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import streamlit as st
import pandas as pd
from huggingface_hub import hf_hub_download
import joblib

# Download and load the trained model
model_path = hf_hub_download(repo_id="Ankurkamboj21/Enginedataset1", filename="best_Model_v1.joblib")
model = joblib.load(model_path)

# Streamlit UI
st.title("Ankur Predictive Maintenance")
st.write("""
This application predicts Engine Condition.
""")

# User input
engine_rpm=st.number_input("Engine rpm")
lub_oil_pressure=st.number_input("Lub oil pressure")
fuel_pressure=st.number_input("Fuel pressure")
coolant_pressure=st.number_input("Coolant pressure")
lub_oil_temp=st.number_input("lub oil temp")
coolant_temp=st.number_input("Coolant temp")


# Assemble input into DataFrame
input_data = pd.DataFrame([{
    'Engine rpm': engine_rpm,
    'Lub oil pressure': lub_oil_pressure,
    'Fuel pressure': fuel_pressure,
    'Coolant pressure': coolant_pressure,
    'lub oil temp': lub_oil_temp,
    'Coolant temp': coolant_temp

}])

# Predict button
if st.button("Submit"):
    prediction = model.predict(input_data)[0]
    results="Engine Condition is Good" if prediction==1 else "Engine Condition is not Good"
    st.subheader("Prediction Result:")
    st.success(f"Estimated Ad Revenue: {results}")