-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
25 lines (20 loc) · 834 Bytes
/
app.py
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
import streamlit as st
import tensorflow as tf
import numpy as np
# Load the trained model
model = tf.keras.models.load_model("ann_model.h5")
# Title of the app
st.title("Energy Output Prediction")
# Sidebar with input fields
st.sidebar.header("Input Variables")
temperature = st.sidebar.number_input("Temperature (AT)", value=0.0)
pressure = st.sidebar.number_input("Pressure (V)", value=0.0)
humidity = st.sidebar.number_input("Humidity (AP)", value=0.0)
vacuum = st.sidebar.number_input("Vacuum (RH)", value=0.0)
# Button to trigger prediction
if st.button("Predict"):
# Make predictions
input_features = np.array([[temperature, pressure, humidity, vacuum]])
prediction = model.predict(input_features)
# Display prediction
st.write("Predicted Energy Output (PE):", prediction[0][0])