asxdmohd commited on
Commit
38ebd94
1 Parent(s): 9164d86

Upload 9 files

Browse files
Files changed (9) hide show
  1. .gitignore +1 -0
  2. Prediction_MODEL_FInal.ipynb +0 -0
  3. Procfile +1 -0
  4. df.pkl +3 -0
  5. laptop_data.csv +0 -0
  6. main.py +68 -0
  7. pipe.pkl +3 -0
  8. requirements.txt +3 -0
  9. setup.sh +9 -0
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ venv
Prediction_MODEL_FInal.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
Procfile ADDED
@@ -0,0 +1 @@
 
 
1
+ web: sh setup.sh && streamlit run app.py
df.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc60b3b8399854aef6b97ad97ef2e4928da652f860f3a4b60173b5a4647051f7
3
+ size 124865
laptop_data.csv ADDED
The diff for this file is too large to render. See raw diff
 
main.py ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import learn as learn
2
+ import streamlit as st
3
+ import pickle
4
+ import numpy as np
5
+ import Scikit-learn
6
+ import sklearn
7
+ import sklearn
8
+ # import the model
9
+ pipe = pickle.load(open('pipe.pkl','rb'))
10
+ df = pickle.load(open('df.pkl','rb'))
11
+
12
+ st.title("Get An Estimated Value For Your Laptop By Filling Out The Details Below:")
13
+
14
+ # brand
15
+ company = st.selectbox('Brand',df['Company'].unique())
16
+
17
+ # type of laptop
18
+ type = st.selectbox('Type',df['TypeName'].unique())
19
+
20
+ # Ram
21
+ ram = st.selectbox('RAM (in GB)',[2,4,6,8,12,16,24,32,64])
22
+
23
+ # weightp
24
+ weight = st.number_input('Weight of the Laptop')
25
+
26
+ # Touchscreen
27
+ touchscreen = st.selectbox('Touchscreen',['No','Yes'])
28
+
29
+ # IPS
30
+ ips = st.selectbox('IPS',['No','Yes'])
31
+
32
+ # screen size
33
+ screen_size = st.number_input('Screen Size (in inches)')
34
+
35
+ # resolution
36
+ resolution = st.selectbox('Screen Resolution',['1920x1080','1366x768','1600x900','3840x2160','3200x1800','2880x1800','2560x1600','2560x1440','2304x1440'])
37
+
38
+ #cpu
39
+ cpu = st.selectbox('CPU',df['Cpu brand'].unique())
40
+
41
+ hdd = st.selectbox('HDD (in GB)',[0,128,256,512,1024,2048])
42
+
43
+ ssd = st.selectbox('SSD (in GB)',[0,8,128,256,512,1024])
44
+
45
+ gpu = st.selectbox('GPU',df['Gpu brand'].unique())
46
+
47
+ os = st.selectbox('OS (Operating System)',df['Os'].unique())
48
+
49
+ if st.button('Predict Price'):
50
+ # query
51
+ ppi = None
52
+ if touchscreen == 'Yes':
53
+ touchscreen = 1
54
+ else:
55
+ touchscreen = 0
56
+
57
+ if ips == 'Yes':
58
+ ips = 1
59
+ else:
60
+ ips = 0
61
+
62
+ X_res = int(resolution.split('x')[0])
63
+ Y_res = int(resolution.split('x')[1])
64
+ ppi = ((X_res**2) + (Y_res**2))**0.5/screen_size
65
+ query = np.array([company,type,ram,weight,touchscreen,ips,ppi,cpu,hdd,ssd,gpu,os])
66
+
67
+ query = query.reshape(1,12)
68
+ st.title("The predicted price of this configuration is " + str(int(np.exp(pipe.predict(query)[0]))))
pipe.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8cdc048a9aca4fd13e3a8bdc7fffd357ae2766e076b015d7d79612044b98ff14
3
+ size 583802
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ streamlit
2
+ scikit-learn
3
+ pickle
setup.sh ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ mkdir -p ~/.streamlit/
2
+
3
+ echo "\
4
+ [server]\n\
5
+ port = $PORT\n\
6
+ enableCORS = false\n\
7
+ headless = true\n\
8
+ \n\
9
+ " > ~/.streamlit/config.toml