Skip to content

Commit 5b1b18a

Browse files
authored
Merge pull request recodehive#302 from ranamanish674zu/newfeature
Job Satisfaction Analysis
2 parents 831b41e + bd01088 commit 5b1b18a

File tree

4 files changed

+718
-0
lines changed

4 files changed

+718
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://drive.google.com/file/d/1CnCnFGRt0LDJibsDuH2690gTPpcB-RJx/view?usp=sharing

Job Satisfaction Analysis/JobSatisfaction.ipynb

Lines changed: 644 additions & 0 deletions
Large diffs are not rendered by default.

Job Satisfaction Analysis/app.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import streamlit as st
2+
import joblib
3+
import pandas as pd
4+
5+
# Load the model
6+
model = joblib.load('model.pkl')
7+
8+
# Define the feature columns used in the model
9+
features = ['Hobby', 'OpenSource', 'Country', 'Student', 'Employment', 'FormalEducation',
10+
'UndergradMajor', 'CompanySize', 'DevType', 'YearsCoding', 'YearsCodingProf']
11+
12+
st.title('Job Satisfaction Prediction')
13+
14+
# Create a form for user input
15+
with st.form(key='prediction_form'):
16+
Hobby = st.selectbox('Hobby:', ['Yes', 'No'])
17+
OpenSource = st.selectbox('Open Source:', ['Yes', 'No'])
18+
Country = st.selectbox('Country:', ['United States', 'India', 'Germany'])
19+
Student = st.selectbox('Student:', ['Yes', 'No'])
20+
Employment = st.selectbox('Employment:', ['Employed full-time', 'Employed part-time', 'Self-employed', 'Unemployed'])
21+
FormalEducation = st.selectbox('Formal Education:', ["Bachelor’s degree (BA, BS, B.Eng., etc.)",
22+
"Master’s degree (MA, MS, M.Eng., MBA, etc.)",
23+
"Doctoral degree (PhD)"])
24+
UndergradMajor = st.selectbox('Undergrad Major:', ["Computer science, computer engineering, or software engineering",
25+
"Information technology, networking, or system administration",
26+
"Other engineering discipline"])
27+
CompanySize = st.selectbox('Company Size:', ['Fewer than 10 employees', '10 to 19 employees', '20 to 99 employees',
28+
'100 to 499 employees', '500 to 999 employees', '1,000 to 4,999 employees'])
29+
DevType = st.selectbox('Dev Type:', ['Developer, back-end', 'Developer, front-end', 'Developer, full-stack'])
30+
YearsCoding = st.selectbox('Years Coding:', ['0-2 years', '3-5 years', '6-8 years', '9-11 years'])
31+
YearsCodingProf = st.selectbox('Years Coding Professionally:', ['0-2 years', '3-5 years', '6-8 years', '9-11 years'])
32+
33+
submit_button = st.form_submit_button(label='Get Prediction')
34+
35+
if submit_button:
36+
# Collect user input
37+
input_data = {
38+
'Hobby': Hobby,
39+
'OpenSource': OpenSource,
40+
'Country': Country,
41+
'Student': Student,
42+
'Employment': Employment,
43+
'FormalEducation': FormalEducation,
44+
'UndergradMajor': UndergradMajor,
45+
'CompanySize': CompanySize,
46+
'DevType': DevType,
47+
'YearsCoding': YearsCoding,
48+
'YearsCodingProf': YearsCodingProf
49+
}
50+
51+
# Convert user input to DataFrame
52+
input_df = pd.DataFrame([input_data])
53+
54+
# Ensure the input has the same columns as the training data
55+
input_df = input_df[features]
56+
57+
# Make prediction
58+
prediction = model.predict(input_df)
59+
60+
# Display the prediction
61+
st.write(f'Predicted Job Satisfaction: {prediction[0]}')
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
here are requirement->
2+
import pandas as pd
3+
import numpy as np
4+
import matplotlib.pyplot as plt
5+
import seaborn as sns
6+
from sklearn.model_selection import train_test_split
7+
from sklearn.preprocessing import StandardScaler, OneHotEncoder
8+
from sklearn.compose import ColumnTransformer
9+
from sklearn.pipeline import Pipeline
10+
from sklearn.impute import SimpleImputer
11+
from sklearn.ensemble import RandomForestClassifier
12+
from sklearn.metrics import accuracy_score, confusion_matrix, classification_report

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy