MVesalA commited on
Commit
57c86cb
1 Parent(s): 7d57589

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -33
app.py CHANGED
@@ -1,34 +1,34 @@
1
- import pandas as pd
2
- import numpy as np
3
- import streamlit as st
4
- import joblib
5
- from sklearn.linear_model import LinearRegression
6
-
7
- model = joblib.load('DeveloperSalary/DeveloperSalary_Pred_Rgs.joblib')
8
- st.title('Salary prediction in 2022')
9
- st.write("""### fill the form for prediction""")
10
-
11
- columns = ['Country', 'EdLevel', 'YearsCode']
12
-
13
-
14
- Country = st.selectbox('Chose your country', ['United States of America', 'Australia', 'Russian Federation',
15
- 'France', 'South Africa', 'Greece', 'Poland', 'Germany', 'Denmark',
16
- 'India', 'United Kingdom of Great Britain and Northern Ireland',
17
- 'Argentina', 'Hungary', 'Switzerland', 'Brazil', 'Italy', 'Spain',
18
- 'Iran, Islamic Republic of...', 'Bangladesh', 'Israel', 'Sweden',
19
- 'Portugal', 'Netherlands', 'Canada', 'Mexico', 'Austria', 'Norway',
20
- 'Finland', 'Czech Republic', 'Belgium', 'Turkey', 'Romania',
21
- 'Ukraine', 'Colombia', 'New Zealand', 'Ireland', 'Pakistan',
22
- 'Japan'])
23
- EdLevel = st.selectbox('What is your educational level ?', ['Master’s degree', 'Bachelor’s degree', 'Less than a Bachelors',
24
- 'Post grad'])
25
- YearsOfCode = st.slider('How many years have you been coding ?', 0, 100)
26
-
27
-
28
- ok = st.button('Pred Salary')
29
- if ok:
30
- rows = np.array([Country, EdLevel, YearsOfCode])
31
- X_new = pd.DataFrame([rows], columns=columns)
32
- Salary = model.predict(X_new)
33
-
34
  st.subheader(f'The estimate salary is ${Salary[0]:.2f}')
 
1
+ import pandas as pd
2
+ import numpy as np
3
+ import streamlit as st
4
+ import joblib
5
+ from sklearn.linear_model import LinearRegression
6
+
7
+ model = joblib.load('DeveloperSalary_Pred_Rgs.joblib')
8
+ st.title('Salary prediction in 2022')
9
+ st.write("""### fill the form for prediction""")
10
+
11
+ columns = ['Country', 'EdLevel', 'YearsCode']
12
+
13
+
14
+ Country = st.selectbox('Chose your country', ['United States of America', 'Australia', 'Russian Federation',
15
+ 'France', 'South Africa', 'Greece', 'Poland', 'Germany', 'Denmark',
16
+ 'India', 'United Kingdom of Great Britain and Northern Ireland',
17
+ 'Argentina', 'Hungary', 'Switzerland', 'Brazil', 'Italy', 'Spain',
18
+ 'Iran, Islamic Republic of...', 'Bangladesh', 'Israel', 'Sweden',
19
+ 'Portugal', 'Netherlands', 'Canada', 'Mexico', 'Austria', 'Norway',
20
+ 'Finland', 'Czech Republic', 'Belgium', 'Turkey', 'Romania',
21
+ 'Ukraine', 'Colombia', 'New Zealand', 'Ireland', 'Pakistan',
22
+ 'Japan'])
23
+ EdLevel = st.selectbox('What is your educational level ?', ['Master’s degree', 'Bachelor’s degree', 'Less than a Bachelors',
24
+ 'Post grad'])
25
+ YearsOfCode = st.slider('How many years have you been coding ?', 0, 100)
26
+
27
+
28
+ ok = st.button('Pred Salary')
29
+ if ok:
30
+ rows = np.array([Country, EdLevel, YearsOfCode])
31
+ X_new = pd.DataFrame([rows], columns=columns)
32
+ Salary = model.predict(X_new)
33
+
34
  st.subheader(f'The estimate salary is ${Salary[0]:.2f}')