CoolFace
Apppublic

jr98rh/developer-salary

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
app.py76 linesDownload Raw Back to root
1import streamlit as st2import numpy as np3import pandas as pd4import joblib5import pickle6 7model = pickle.load(open("PycaretGBR.pkl", 'rb'))8# model = joblib.load("lr.joblib")9st.title('Developer Salary Prediction 2024')10st.write("""### We need some information to predict the salary""")11 12countries = (13"Australia",14"Austria",15"Belgium",16"Brazil",17"Canada",18"Czech Republic",19"Denmark",20"France",21"Germany",22"India",23"Israel",24"Italy",25"Netherlands",26"Norway",27"Poland",28"Russian Federation",29"Spain",30"Sweden",31"Switzerland",32"Ukraine"33"United Kingdom of Great Britain and Northern Ireland",34"United States of America"35)36 37education = (38    "Less than a Bachelors",39    "Bachelor’s degree",40    "Master’s degree",41    "Post grad"42)43 44employment = (45    "Employed, full-time",46    "Independent contractor, freelancer, or self-employed",47    "Student, part-time",48    "Retired", 49    "Not employed, but looking for work",50    "Employed, part-time",51    "Student, full-time"52)53 54country = st.selectbox("Country", countries)55education = st.selectbox("Education Level", education)56expericence = st.slider("Years of Experience", 0, 50, 3)57employment = st.selectbox("Employment Type", employment)58 59columns = ['Country', 'EdLevel', 'YearsCodePro', 'Employment']60 61ok = st.button("Calculate Salary")62if ok:63    X_new_df = pd.DataFrame([[country,education,expericence,employment]],64                            columns = ['Country', 'EdLevel', 'YearsCodePro', 'Employment'])65    print("##########")66    print("##########")67    print("##########")68    print(model)69    print("##########")70    print("##########")71    print("##########")72    salary = model.predict(X_new_df)73    74    st.subheader(f"The estimated salary is {salary[0]:.2f} $")\75 76