-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
56 lines (45 loc) · 1.75 KB
/
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#Importing libraries
import streamlit as st
import pandas as pd
import numpy as np
from prediction import predict
st.title('Caustic Consumption Prediction')
#User input for model parameters
st.markdown("<h3 style='text-align: left; color: black;'>Model Parameters</h3>", unsafe_allow_html=True)
nfccu = st.slider('NFCCU Feed Rate', 70.0, 220.0, 80.0)
ofccu = st.slider('OFCCU Feed Rate', 70.0, 120.0, 80.0)
ltu = st.slider('LTU Feed Rate', 70.0, 110.0, 80.0)
st.write('---')
option = st.selectbox(
'Time period',
('Daily', 'Weekly', 'Fortnightly', 'Monthly', 'Quarterly'))
# label_visibility="hidden")
# st.write('---')
if nfccu>=80 and ofccu>=80 and ltu>=80:
result = predict(np.array([[nfccu, ofccu, ltu]]))
isom_chk = st.checkbox('Include ISOM consumption')
if isom_chk:
isom = st.number_input('Enter ISOM Consumption: ')
# st.code(3.14*(result[0]+isom)*0.01*2.50*2.50*1.495*1.4*1.25)
ans = 3.14*(result[0]+isom)*0.01*2.50*2.50*1.495*1.4*1.25
else:
# st.code(3.14*(result[0])*0.01*2.50*2.50*1.495*1.4*1.25)
ans = 3.14*(result[0])*0.01*2.50*2.50*1.495*1.4*1.25
st.write('---')
if option=='Daily':
st.text("Predicted output in tonne(Daily):")
st.code(round(ans/7,2))
elif option=='Weekly':
st.text("Predicted output in tonne(Weekly):")
st.code(round(ans,2))
elif option=='Fortnightly':
st.text("Predicted output in tonne(Fortnightly):")
st.code(round(ans*15/7,2))
elif option=='Monthly':
st.text("Predicted output in tonne(Monthly):")
st.code(round(ans*30/7,2))
elif option=='Quarterly':
st.text("Predicted output in tonne(Quarterly):")
st.code(round(ans*12,2))
else:
st.text("Start-up Phase")