Spaces:
Sleeping
Sleeping
kuwa hore
Browse files- requirements.txt +11 -3
- salary_prediction_model.pkl +3 -0
- streamlit_app.py +29 -0
requirements.txt
CHANGED
|
@@ -1,3 +1,11 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
streamlit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fastapi
|
| 2 |
+
uvicorn
|
| 3 |
+
streamlit
|
| 4 |
+
requests
|
| 5 |
+
joblib
|
| 6 |
+
numpy
|
| 7 |
+
pandas
|
| 8 |
+
matplotlib
|
| 9 |
+
seaborn
|
| 10 |
+
scikit-learn
|
| 11 |
+
pydantic
|
salary_prediction_model.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a0aa11e6460aa11df099849e890a088dcae64e6898bde2b5eb86e5cfc22d9bde
|
| 3 |
+
size 1724369
|
streamlit_app.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import requests
|
| 3 |
+
|
| 4 |
+
st.title("Salary Prediction App")
|
| 5 |
+
|
| 6 |
+
# Input fields for user
|
| 7 |
+
Gender = st.selectbox("Gender", ["Male", "Female"])
|
| 8 |
+
Education_Level = st.selectbox("Education Level", ["Bachelor", "Master", "PhD"])
|
| 9 |
+
Job_Title = st.selectbox("Job Title", ["Data Scientist", "Software Engineer", "Product Manager", "Business Analyst", "HR Specialist"])
|
| 10 |
+
Age = st.number_input("Age", min_value=18, max_value=70, value=25)
|
| 11 |
+
Years_of_Experience = st.number_input("Years of Experience", min_value=0.0, max_value=50.0, value=1.0)
|
| 12 |
+
|
| 13 |
+
# Encode Gender (assuming 0 for Female, 1 for Male)
|
| 14 |
+
gender_encoded = 1 if Gender == "Male" else 0
|
| 15 |
+
|
| 16 |
+
if st.button("Predict Salary"):
|
| 17 |
+
payload = {
|
| 18 |
+
"Gender": gender_encoded,
|
| 19 |
+
"Job_Title": Job_Title,
|
| 20 |
+
"Education_Level": Education_Level,
|
| 21 |
+
"Age": Age,
|
| 22 |
+
"Years_of_Experience": Years_of_Experience
|
| 23 |
+
}
|
| 24 |
+
response = requests.post("http://localhost:8000/predict", json=payload)
|
| 25 |
+
if response.status_code == 200:
|
| 26 |
+
result = response.json()
|
| 27 |
+
st.success(f"Predicted Salary: {result['predicted_salary']}")
|
| 28 |
+
else:
|
| 29 |
+
st.error("Error: Could not get prediction from API.")
|