|
import streamlit as st |
|
import joblib |
|
|
|
|
|
model = joblib.load("Tesla_Elon_Regression_Model.pkl") |
|
|
|
|
|
model_info = joblib.load("model_info.pkl") |
|
|
|
st.title("Predict developer paycheck") |
|
st.write("Predict developer salaries based on a Stack Overflow dataset") |
|
|
|
feature_values = {} |
|
for feature in model_info["features"]: |
|
if feature is "yearsCode" or feature is "yearsCodePro": |
|
feature_values[feature] = st.number_input(f"Enter {feature}", min_value=0.0) |
|
else: |
|
feature_values[feature] = st.text_input(f"Enter {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 Stock Price: {prediction[0]}") |