CoolFace
Apppublic

Yiqiu9/Energy_Efficiency_Prediction_Model

sourceHugging Faceupdated 10mo agoView on Hugging Face
0likes
streamlit_app.py45 linesDownload Raw Back to root
1import streamlit as st2import numpy as np3import joblib4from tensorflow.keras.models import load_model5 6# Load models and scaler7@st.cache_resource8def load_heat_model():9    return load_model("heat_model_fixed.keras", compile=False)10 11@st.cache_resource12def load_cool_model():13    return load_model("cool_model_fixed.keras", compile=False)14 15@st.cache_resource16def load_scaler():17    return joblib.load("scaler.pkl")18 19heat_model = load_heat_model()20cool_model = load_cool_model()21scaler = load_scaler()22 23st.title("Energy Prediction App")24 25st.write("Enter 8 features:")26 27# Create 8 numeric inputs28inputs = []29for i in range(8):30    val = st.number_input(f"Feature {i+1}", value=0.0)31    inputs.append(val)32 33inputs = np.array(inputs).reshape(1, -1)34 35# Scale36scaled = scaler.transform(inputs)37 38# Predict39if st.button("Predict"):40    heat = heat_model.predict(scaled)[0][0]41    cool = cool_model.predict(scaled)[0][0]42 43    st.success(f"Predicted Heating Load: {heat:.2f}")44    st.success(f"Predicted Cooling Load: {cool:.2f}")45