File size: 1,458 Bytes
7d57589
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import pandas as pd
import numpy as np
import streamlit as st
import joblib
from sklearn.linear_model import LinearRegression

model = joblib.load('DeveloperSalary/DeveloperSalary_Pred_Rgs.joblib')
st.title('Salary prediction in 2022')
st.write("""### fill the form for prediction""")

columns = ['Country', 'EdLevel', 'YearsCode']


Country = st.selectbox('Chose your country', ['United States of America', 'Australia', 'Russian Federation',
       'France', 'South Africa', 'Greece', 'Poland', 'Germany', 'Denmark',
       'India', 'United Kingdom of Great Britain and Northern Ireland',
       'Argentina', 'Hungary', 'Switzerland', 'Brazil', 'Italy', 'Spain',
       'Iran, Islamic Republic of...', 'Bangladesh', 'Israel', 'Sweden',
       'Portugal', 'Netherlands', 'Canada', 'Mexico', 'Austria', 'Norway',
       'Finland', 'Czech Republic', 'Belgium', 'Turkey', 'Romania',
       'Ukraine', 'Colombia', 'New Zealand', 'Ireland', 'Pakistan',
       'Japan'])
EdLevel = st.selectbox('What is your educational level ?', ['Master’s degree', 'Bachelor’s degree', 'Less than a Bachelors',
       'Post grad'])
YearsOfCode = st.slider('How many years have you been coding ?', 0, 100)


ok = st.button('Pred Salary')
if ok:
    rows = np.array([Country, EdLevel, YearsOfCode])
    X_new = pd.DataFrame([rows], columns=columns)
    Salary = model.predict(X_new)

    st.subheader(f'The estimate salary is ${Salary[0]:.2f}')