File size: 1,733 Bytes
07f2c5b
 
fd218db
07f2c5b
e855b76
fd218db
07f2c5b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import streamlit as st
import numpy as np
import pandas as pd
import joblib
import pickle

model = pickle.load(open("PycaretGBR.pkl", 'rb'))
# model = joblib.load("lr.joblib")
st.title('Developer Salary Prediction 2024')
st.write("""### We need some information to predict the salary""")

countries = (
"Australia",
"Austria",
"Belgium",
"Brazil",
"Canada",
"Czech Republic",
"Denmark",
"France",
"Germany",
"India",
"Israel",
"Italy",
"Netherlands",
"Norway",
"Poland",
"Russian Federation",
"Spain",
"Sweden",
"Switzerland",
"Ukraine"
"United Kingdom of Great Britain and Northern Ireland",
"United States of America"
)

education = (
    "Less than a Bachelors",
    "Bachelor’s degree",
    "Master’s degree",
    "Post grad"
)

employment = (
    "Employed, full-time",
    "Independent contractor, freelancer, or self-employed",
    "Student, part-time",
    "Retired", 
    "Not employed, but looking for work",
    "Employed, part-time",
    "Student, full-time"
)

country = st.selectbox("Country", countries)
education = st.selectbox("Education Level", education)
expericence = st.slider("Years of Experience", 0, 50, 3)
employment = st.selectbox("Employment Type", employment)

columns = ['Country', 'EdLevel', 'YearsCodePro', 'Employment']

ok = st.button("Calculate Salary")
if ok:
    X_new_df = pd.DataFrame([[country,education,expericence,employment]],
                            columns = ['Country', 'EdLevel', 'YearsCodePro', 'Employment'])
    print("##########")
    print("##########")
    print("##########")
    print(model)
    print("##########")
    print("##########")
    print("##########")
    salary = model.predict(X_new_df)
    
    st.subheader(f"The estimated salary is {salary[0]:.2f} $")\