Spaces:
Sleeping
Sleeping
NaikPriyank
commited on
Upload 6 files
Browse files- Laptop.ipynb +0 -0
- app.py +54 -0
- df.pkl +3 -0
- laptop_data.csv +0 -0
- pipe.pkl +3 -0
- requirement.txt +0 -0
Laptop.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
app.py
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pickle
|
3 |
+
import numpy as np
|
4 |
+
|
5 |
+
pipe = pickle.load(open('pipe.pkl','rb'))
|
6 |
+
df = pickle.load(open('df.pkl','rb'))
|
7 |
+
|
8 |
+
st.title("Laptop Price Predictor")
|
9 |
+
|
10 |
+
company = st.selectbox('Brand',df['Company'].unique())
|
11 |
+
|
12 |
+
type = st.selectbox('Type',df['TypeName'].unique())
|
13 |
+
|
14 |
+
ram = st.selectbox('RAM(in GB)',[2,4,6,8,12,16,24,32,64])
|
15 |
+
|
16 |
+
weight = st.number_input('Weight of the Laptop ')
|
17 |
+
|
18 |
+
touchscreen = st.selectbox('Touchscreen',['No','Yes'])
|
19 |
+
|
20 |
+
ips = st.selectbox('IPS',['No','Yes'])
|
21 |
+
|
22 |
+
screen_size = st.number_input('Screen Size')
|
23 |
+
|
24 |
+
resolution = st.selectbox('Screen Resolution',['1920x1080','1366x768','1600x900','3840x2160','3200x1800','2880x1800','2560x1600','2560x1440','2304x1440'])
|
25 |
+
|
26 |
+
cpu = st.selectbox('CPU',df['Cpu brand'].unique())
|
27 |
+
|
28 |
+
hdd = st.selectbox('HDD(in GB)',[0,128,256,512,1024,2048])
|
29 |
+
|
30 |
+
ssd = st.selectbox('SSD(in GB)',[0,8,128,256,512,1024])
|
31 |
+
|
32 |
+
gpu = st.selectbox('GPU',df['Gpu Brand'].unique())
|
33 |
+
|
34 |
+
os = st.selectbox('OS',df['OS_Brand'].unique())
|
35 |
+
|
36 |
+
if st.button('Predict Price'):
|
37 |
+
ppi = None
|
38 |
+
if touchscreen == 'Yes':
|
39 |
+
touchscreen = 1
|
40 |
+
else:
|
41 |
+
touchscreen = 0
|
42 |
+
|
43 |
+
if ips == 'Yes':
|
44 |
+
ips = 1
|
45 |
+
else:
|
46 |
+
ips = 0
|
47 |
+
|
48 |
+
X_res = int(resolution.split('x')[0])
|
49 |
+
Y_res = int(resolution.split('x')[1])
|
50 |
+
ppi = ((X_res**2) + (Y_res**2))**0.5/screen_size
|
51 |
+
|
52 |
+
query = np.array([company,type,ram,weight,touchscreen,ips,ppi,cpu,hdd,ssd,gpu,os])
|
53 |
+
query = query.reshape(1,12)
|
54 |
+
st.title("The predicted Price of this Configuration is Rs." + str(int(np.exp(pipe.predict(query)[0]))))
|
df.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e0554a6fb0c97293bd11079ef2ce8e4a7f7c6d77c81f0dea913cd4e836efda90
|
3 |
+
size 124872
|
laptop_data.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
pipe.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3b3b92429694bcfd7429a25bac76393739b2586a9f6fd8204bbeae57a270fcf0
|
3 |
+
size 4868909
|
requirement.txt
ADDED
Binary file (18.1 kB). View file
|
|