-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
48 lines (29 loc) · 912 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
# coding: utf-8
# In[4]:
import pandas as pd
import numpy as np
import streamlit as st
from prediction import predict
# In[6]:
st.title('Predict Mileage per Galon')
st.markdown('Model to predict MPG of a car')
st.header('Car Features')
col1,col2,col3,col4=st.columns(4)
with col1:
cylinders = st.slider('cylinders',2,8,1)
displacement = st.slider('displacement',50,500,10)
with col2:
horsepower = st.slider('horse power',50,500,10)
weight = st.slider('weight',1500,5000,50)
with col3:
acceleration = st.slider('acceleration',8,25,1)
modelyear = st.slider('model year',70,85,1)
with col4:
origin = st.slider('Origin',1,3,1)
# st.button('Predict MPG of a Car')
# In[7]:
if st.button('Predict MPG of a Car'):
result=predict(np.array([[cylinders,displacement,horsepower,weight,acceleration,modelyear,origin]]))
st.text(result[0])
# In[ ]: