wiaandev's picture
Update app.py
188f89d
raw
history blame
790 Bytes
import streamlit as st
import joblib
# load the model
model = joblib.load("Coder-Paycheck-Predict-Model.pkl")
# Load the model information
model_info = joblib.load("model_info.pkl")
st.title("Predict Developer Salary")
st.write("Predict developer salaries based on a Stack Overflow dataset")
feature_values = {}
for feature in model_info["features"]:
if feature == "YearsCode" or feature == "YearsCodePro":
feature_values[feature] = st.number_input(f"Enter {feature}", min_value=0.0)
else:
feature_values[feature] = st.checkbox(f"{feature}")
if st.button("Predict Salary"):
input_features = [feature_values[feature] for feature in model_info["features"]]
prediction = model.predict([input_features])[0]
st.write(f"Predicted Salary: {prediction[0]}")