Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,22 +2,22 @@ import streamlit as st
|
|
| 2 |
import joblib
|
| 3 |
|
| 4 |
# load the model
|
| 5 |
-
model = joblib.load("
|
| 6 |
|
| 7 |
# Load the model information
|
| 8 |
model_info = joblib.load("model_info.pkl")
|
| 9 |
|
| 10 |
-
st.title("Predict
|
| 11 |
st.write("Predict developer salaries based on a Stack Overflow dataset")
|
| 12 |
|
| 13 |
feature_values = {}
|
| 14 |
for feature in model_info["features"]:
|
| 15 |
-
if feature
|
| 16 |
feature_values[feature] = st.number_input(f"Enter {feature}", min_value=0.0)
|
| 17 |
else:
|
| 18 |
-
feature_values[feature] = st.
|
| 19 |
|
| 20 |
if st.button("Predict Salary"):
|
| 21 |
input_features = [feature_values[feature] for feature in model_info["features"]]
|
| 22 |
prediction = model.predict([input_features])[0]
|
| 23 |
-
st.write(f"Predicted
|
|
|
|
| 2 |
import joblib
|
| 3 |
|
| 4 |
# load the model
|
| 5 |
+
model = joblib.load("Coder-Paycheck-Predict-Model.pkl")
|
| 6 |
|
| 7 |
# Load the model information
|
| 8 |
model_info = joblib.load("model_info.pkl")
|
| 9 |
|
| 10 |
+
st.title("Predict Developer Salary")
|
| 11 |
st.write("Predict developer salaries based on a Stack Overflow dataset")
|
| 12 |
|
| 13 |
feature_values = {}
|
| 14 |
for feature in model_info["features"]:
|
| 15 |
+
if feature == "YearsCode" or feature == "YearsCodePro":
|
| 16 |
feature_values[feature] = st.number_input(f"Enter {feature}", min_value=0.0)
|
| 17 |
else:
|
| 18 |
+
feature_values[feature] = st.checkbox(f"{feature}")
|
| 19 |
|
| 20 |
if st.button("Predict Salary"):
|
| 21 |
input_features = [feature_values[feature] for feature in model_info["features"]]
|
| 22 |
prediction = model.predict([input_features])[0]
|
| 23 |
+
st.write(f"Predicted Salary: {prediction[0]}")
|