frrnnda7 commited on
Commit
06a2900
·
1 Parent(s): b9639b6

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +52 -0
app.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import pickle
4
+
5
+ st.title("predict Phone Proces")
6
+
7
+ #import
8
+ svr1 = 'svr.pkl'
9
+ sv = pickle.load(open(svr1, 'rb'))
10
+
11
+ st.write('Insert feature to predict')
12
+ Name = st.slider(label='Name', min_value=0, max_value=200, value=42, step=1)
13
+ Ratings = st.selectbox(label='anemia', options=['0', '1'])
14
+ Prices = st.slider(label='Prices', min_value=0, max_value=1000, value=420, step=1)
15
+ Ram = st.selectbox(label='Ram (GB)', options=['0', '1'])
16
+ Rom = st.slider(label='Rom(GB)', min_value=0, max_value=200, value=42, step=1)
17
+ ScreenSize = st.selectbox(label='Screen Size(Inches)', options=['0', '1'])
18
+ FirstCam = st.slider(label='First Cam (MP)', min_value=100000.0, max_value=999999.0, value=420000.0, step=0.01)
19
+ SecondCam = st.slider(label='Second Cam (MP)', min_value=0.0, max_value=99.9, value=42.0, step=0.1)
20
+ ThirdCam = st.slider(label='Third Cam (MP)', min_value=0, max_value=999, value=42, step=1)
21
+ FourthCam = st.selectbox(label='Fourth Cam (MP)', options=['0', '1'])
22
+ FrontCam = st.selectbox(label='Front Cam (MP)', options=['0', '1'])
23
+ Battery= st.slider(label='Batery (mAh)', min_value=0, max_value=999, value=42, step=1)
24
+
25
+
26
+
27
+ # color = st.number_input(label='Colour', min_value=240, max_value=255, value=245, step=1)
28
+
29
+ # convert into dataframe
30
+
31
+ data = pd.DataFrame({'Name': [Name],
32
+ 'Ratings': [Ratings],
33
+ 'Prices': [Prices],
34
+ 'Ram ':[Ram],
35
+ 'Rom': [Rom],
36
+ 'ScreenSize': [ScreenSize],
37
+ 'FirstCam ': [FirstCam],
38
+ 'SecondCam': [SecondCam],
39
+ 'ThirdCam': [ThirdCam],
40
+ 'FourthCam': [FourthCam],
41
+ 'FrontCam': [FrontCam],
42
+ 'Battery': [Battery]})
43
+
44
+ # model predict
45
+ Phone_price = svr1.predict(data).tolist()[0]
46
+
47
+ # interpretation
48
+ st.write('Predition Result: ')
49
+ if Phone_price == 0:
50
+ st.text('Mahal Jon')
51
+ else:
52
+ st.text('Sikat')