Spaces:
Runtime error
Runtime error
Upload 2 files
Browse files- DeveloperSalary_Pred_Rgs.joblib +3 -0
- app.py +34 -0
DeveloperSalary_Pred_Rgs.joblib
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ea120deb3d074caa8d3914d2fca0b0a5fd84e5af40c804acdb0897d327939b4e
|
3 |
+
size 4439
|
app.py
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pandas as pd
|
2 |
+
import numpy as np
|
3 |
+
import streamlit as st
|
4 |
+
import joblib
|
5 |
+
from sklearn.linear_model import LinearRegression
|
6 |
+
|
7 |
+
model = joblib.load('DeveloperSalary/DeveloperSalary_Pred_Rgs.joblib')
|
8 |
+
st.title('Salary prediction in 2022')
|
9 |
+
st.write("""### fill the form for prediction""")
|
10 |
+
|
11 |
+
columns = ['Country', 'EdLevel', 'YearsCode']
|
12 |
+
|
13 |
+
|
14 |
+
Country = st.selectbox('Chose your country', ['United States of America', 'Australia', 'Russian Federation',
|
15 |
+
'France', 'South Africa', 'Greece', 'Poland', 'Germany', 'Denmark',
|
16 |
+
'India', 'United Kingdom of Great Britain and Northern Ireland',
|
17 |
+
'Argentina', 'Hungary', 'Switzerland', 'Brazil', 'Italy', 'Spain',
|
18 |
+
'Iran, Islamic Republic of...', 'Bangladesh', 'Israel', 'Sweden',
|
19 |
+
'Portugal', 'Netherlands', 'Canada', 'Mexico', 'Austria', 'Norway',
|
20 |
+
'Finland', 'Czech Republic', 'Belgium', 'Turkey', 'Romania',
|
21 |
+
'Ukraine', 'Colombia', 'New Zealand', 'Ireland', 'Pakistan',
|
22 |
+
'Japan'])
|
23 |
+
EdLevel = st.selectbox('What is your educational level ?', ['Master’s degree', 'Bachelor’s degree', 'Less than a Bachelors',
|
24 |
+
'Post grad'])
|
25 |
+
YearsOfCode = st.slider('How many years have you been coding ?', 0, 100)
|
26 |
+
|
27 |
+
|
28 |
+
ok = st.button('Pred Salary')
|
29 |
+
if ok:
|
30 |
+
rows = np.array([Country, EdLevel, YearsOfCode])
|
31 |
+
X_new = pd.DataFrame([rows], columns=columns)
|
32 |
+
Salary = model.predict(X_new)
|
33 |
+
|
34 |
+
st.subheader(f'The estimate salary is ${Salary[0]:.2f}')
|