wiaandev commited on
Commit
188f89d
·
1 Parent(s): b135c67

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -2,22 +2,22 @@ import streamlit as st
2
  import joblib
3
 
4
  # load the model
5
- model = joblib.load("Tesla_Elon_Regression_Model.pkl")
6
 
7
  # Load the model information
8
  model_info = joblib.load("model_info.pkl")
9
 
10
- st.title("Predict developer paycheck")
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 is "yearsCode" or feature is "yearsCodePro":
16
  feature_values[feature] = st.number_input(f"Enter {feature}", min_value=0.0)
17
  else:
18
- feature_values[feature] = st.text_input(f"Enter {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 Stock Price: {prediction[0]}")
 
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]}")