|
|
| import streamlit as st |
| import pandas as pd |
| import joblib |
|
|
| from huggingface_hub import hf_hub_download |
|
|
| |
| |
| |
|
|
| model_path = hf_hub_download( |
| repo_id="geniusut/engine-predictive-maintenance-model", |
| filename="best_model.pkl" |
| ) |
|
|
| model = joblib.load(model_path) |
|
|
| |
| |
| |
|
|
| st.title("Engine Predictive Maintenance") |
|
|
| st.write( |
| "Enter engine operational parameters " |
| "to predict maintenance requirements." |
| ) |
|
|
| |
| |
| |
|
|
| engine_rpm = st.number_input( |
| "Engine RPM", |
| value=800.0 |
| ) |
|
|
| lub_oil_pressure = st.number_input( |
| "Lub Oil Pressure", |
| value=3.5 |
| ) |
|
|
| fuel_pressure = st.number_input( |
| "Fuel Pressure", |
| value=6.5 |
| ) |
|
|
| coolant_pressure = st.number_input( |
| "Coolant Pressure", |
| value=2.5 |
| ) |
|
|
| lub_oil_temp = st.number_input( |
| "Lub Oil Temperature", |
| value=75.0 |
| ) |
|
|
| coolant_temp = st.number_input( |
| "Coolant Temperature", |
| value=80.0 |
| ) |
|
|
| |
| |
| |
|
|
| input_data = pd.DataFrame([{ |
| "Engine_RPM": engine_rpm, |
| "Lub_Oil_Pressure": lub_oil_pressure, |
| "Fuel_Pressure": fuel_pressure, |
| "Coolant_Pressure": coolant_pressure, |
| "Lub_Oil_Temperature": lub_oil_temp, |
| "Coolant_Temperature": coolant_temp |
| }]) |
|
|
| |
| |
| |
|
|
| if st.button("Predict"): |
|
|
| prediction = model.predict(input_data)[0] |
|
|
| result = ( |
| "Maintenance Required" |
| if prediction == 1 |
| else "Engine Operating Normally" |
| ) |
|
|
| st.success(f"Prediction Result: {result}") |
|
|