Spaces:
Runtime error
Runtime error
innoefawwaz1
commited on
Commit
•
31fc692
1
Parent(s):
fea8e26
:smiley: German Price Prediction Commit
Browse files- M2P1_pred.pkl +3 -0
- app.py +50 -0
- requirements.txt +4 -0
M2P1_pred.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:726bfe25a1d965b190b3d8225f4fb45eb38a36b6992b5a29e3506ff410817b61
|
3 |
+
size 5642
|
app.py
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import feature_engine
|
3 |
+
import pandas as pd
|
4 |
+
import pickle
|
5 |
+
|
6 |
+
st.title("Used car sales price prediction")
|
7 |
+
|
8 |
+
# import model
|
9 |
+
model = pickle.load(open("M2P1_pred.pkl", "rb"))
|
10 |
+
|
11 |
+
st.write('Insert features First:')
|
12 |
+
|
13 |
+
# user input
|
14 |
+
odometer = st.slider(label='odometer', min_value=0, max_value=150000, step=1)
|
15 |
+
powerPS = st.slider(label='powerPS', min_value=1, max_value=923, step=1)
|
16 |
+
yearOfRegistration = st.slider(label='yearOfRegistration', min_value=1863, max_value=2016, step=1)
|
17 |
+
gearbox = st.selectbox(label='gearbox', options=['automatik', 'manuell'])
|
18 |
+
models = st.selectbox(label='model', options=['7er', 'golf', 'a3', 'scirocco', 'e_klasse', 'c_klasse', 'a1',
|
19 |
+
'a_klasse', 's_klasse', 'passat', 'corsa', '3er', '1er', '5er',
|
20 |
+
'a6', 'a4', 'transporter', 'vito', '100', 'm_klasse', 'lupo',
|
21 |
+
'touareg', 'andere', 'touran', 'x_reihe', 'tigra', 'signum',
|
22 |
+
'sharan', 'a5', 'beetle', 'phaeton', 'sl', 'insignia', 'up', '80',
|
23 |
+
'z_reihe', 'clk', 'vivaro', 'tiguan', 'sprinter', 'astra', 'viano',
|
24 |
+
'bora', 'fox', 'polo', 'zafira', 'meriva', 'vectra', 'omega', 'a8',
|
25 |
+
'caddy', 'tt', 'eos', 'slk', 'm_reihe', 'glk', 'combo', 'a2',
|
26 |
+
'b_klasse', 'cc', 'v_klasse', 'jetta', 'q7', 'cl', '90', 'q3',
|
27 |
+
'q5', 'agila', 'calibra', 'kaefer', 'gl', 'amarok', 'antara',
|
28 |
+
'kadett', '6er', 'g_klasse', '200'])
|
29 |
+
fuelType = st.selectbox(label='fuelType', options=['benzin', 'diesel', 'lpg', 'cng', 'andere', 'hybrid', 'elektro'])
|
30 |
+
brand = st.selectbox(label='brand', options=['volkswagen', 'audi', 'opel', 'mercedes_benz', 'bmw'])
|
31 |
+
|
32 |
+
|
33 |
+
# convert into dataframe
|
34 |
+
data = pd.DataFrame({'odometer': [odometer],
|
35 |
+
'powerPS': [powerPS],
|
36 |
+
'yearOfRegistration': [yearOfRegistration],
|
37 |
+
'gearbox':[gearbox],
|
38 |
+
'model': [models],
|
39 |
+
'fuelType': [fuelType],
|
40 |
+
'brand': [brand],
|
41 |
+
})
|
42 |
+
data
|
43 |
+
# model predict
|
44 |
+
clas = model.predict(data).tolist()[0]
|
45 |
+
|
46 |
+
#Intepretation
|
47 |
+
if st.button('Predict'):
|
48 |
+
st.write('The used car price is : ', clas, 'USD')
|
49 |
+
|
50 |
+
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
streamlit
|
2 |
+
pandas
|
3 |
+
scikit-learn==1.1.2
|
4 |
+
feature_engine==1.5.1
|