Update app.py
Browse files
app.py
CHANGED
@@ -2,13 +2,13 @@ import joblib
|
|
2 |
import pandas as pd
|
3 |
import streamlit as st
|
4 |
|
5 |
-
|
6 |
'Mid-level': 2,
|
7 |
'Senior-level': 3,
|
8 |
'Executive-level': 4
|
9 |
}
|
10 |
|
11 |
-
|
12 |
'Medium : 50 to 250 employees': 2,
|
13 |
'Large : more than 250 employees': 3,
|
14 |
}
|
@@ -40,11 +40,11 @@ def main():
|
|
40 |
# clicked==True only when the button is clicked
|
41 |
clicked = st.form_submit_button("Predict Data Science Job Salaries")
|
42 |
if clicked:
|
43 |
-
result=model.predict(pd.DataFrame({"experience_level": [
|
44 |
"employment_type" : [employment_type],
|
45 |
"job_title": [job_title],
|
46 |
"remote_ratio": [remote_ratio_dict[remote_ratio]],
|
47 |
-
"company_size": [
|
48 |
# Show prediction
|
49 |
salary_in_usd = str(round(float(result),2))
|
50 |
st.success("Your predicted Data Science job salaries in usd is " +result)
|
|
|
2 |
import pandas as pd
|
3 |
import streamlit as st
|
4 |
|
5 |
+
Experience_dict = {'Entry-level': 1,
|
6 |
'Mid-level': 2,
|
7 |
'Senior-level': 3,
|
8 |
'Executive-level': 4
|
9 |
}
|
10 |
|
11 |
+
Company_size_dict = {'Small : less than 50 employees': 1,
|
12 |
'Medium : 50 to 250 employees': 2,
|
13 |
'Large : more than 250 employees': 3,
|
14 |
}
|
|
|
40 |
# clicked==True only when the button is clicked
|
41 |
clicked = st.form_submit_button("Predict Data Science Job Salaries")
|
42 |
if clicked:
|
43 |
+
result=model.predict(pd.DataFrame({"experience_level": [Experience_dict[experience_level]],
|
44 |
"employment_type" : [employment_type],
|
45 |
"job_title": [job_title],
|
46 |
"remote_ratio": [remote_ratio_dict[remote_ratio]],
|
47 |
+
"company_size": [Company_size_dict[company_size]]}))
|
48 |
# Show prediction
|
49 |
salary_in_usd = str(round(float(result),2))
|
50 |
st.success("Your predicted Data Science job salaries in usd is " +result)
|