Commit
•
0c8533e
1
Parent(s):
6d52c87
Upload 3 files
Browse files
app.py
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import numpy as np
|
3 |
+
import pandas as pd
|
4 |
+
import pickle
|
5 |
+
|
6 |
+
pipe = pickle.load(open('pipe.pkl','rb'))
|
7 |
+
df = pickle.load(open('df.pkl','rb'))
|
8 |
+
|
9 |
+
st.title("Mobile Price Prediction")
|
10 |
+
|
11 |
+
|
12 |
+
brand = st.selectbox('Brand',df['Brand'].unique())
|
13 |
+
|
14 |
+
color = st.selectbox('color',df['Color'].unique())
|
15 |
+
|
16 |
+
# Touchscreen = st.selectbox('Touch Screen',[0,1])
|
17 |
+
|
18 |
+
display_size = st.number_input('Enter display Size')
|
19 |
+
|
20 |
+
os = st.selectbox('OS',df['Operating System'].unique())
|
21 |
+
|
22 |
+
processor_core = st.selectbox('Cores',df['Processor Core'].unique())
|
23 |
+
|
24 |
+
Internal_Storage = st.selectbox('Internal Storage',[32,64,128,256,512,1024])
|
25 |
+
|
26 |
+
primary_camera = st.selectbox('Primary Camera',[5,8,12,16,32,48,50,108,200])
|
27 |
+
|
28 |
+
# secondary_camera = st.selectbox('Secondary Camera',[0,1])
|
29 |
+
|
30 |
+
# wifi = st.selectbox('Wifi',[0,1])
|
31 |
+
|
32 |
+
battery = st.selectbox('Battery Capacity In MAH',[2000,2500,3000,3500,4000,4250,4500,4750,5000,6000,7000])
|
33 |
+
|
34 |
+
# smartphone = st.selectbox('Smart Phone',[0,1])
|
35 |
+
|
36 |
+
# X_res = st.number_input("X_resolution")
|
37 |
+
|
38 |
+
# y_res = st.number_input("Y_resolution")
|
39 |
+
|
40 |
+
proce = st.selectbox('Processor Brand',df['Processor'].unique())
|
41 |
+
|
42 |
+
g = st.selectbox('5G',['Yes','No'])
|
43 |
+
|
44 |
+
|
45 |
+
if st.button('Pridict'):
|
46 |
+
if g=='Yes':
|
47 |
+
gg = 1
|
48 |
+
else:
|
49 |
+
gg = 0
|
50 |
+
query = pd.DataFrame([[brand,color,1,display_size,os,processor_core,Internal_Storage,primary_camera,1,1,battery,1,2400,1080,proce,gg]],columns=['Brand','Color','Touchscreen','Display_size_inches','Operating System','Processor Core','Internal Storage','Primary Camera','Secondary Camera Available','Wi-Fi','Battery Capacity','SmartPhone','X_res','Y_res','Processor','5G'])
|
51 |
+
# st.title(query)
|
52 |
+
st.title(f"The Predicted Price RS:- {int(pipe.predict(query)[0])}")
|
53 |
+
|
54 |
+
|
df.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:32d42c96912ad39e182b162562b6f65e5dfc8c90736e6ab8741b7aecfefb36e2
|
3 |
+
size 85234
|
pipe.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fedf5c8803a4c92fc9d4d56f1d331bfceb5d247352adb50ce494055624fd99b4
|
3 |
+
size 134655
|