File size: 2,358 Bytes
1e1722c 60661a8 1e1722c 60661a8 c2ac57f e31aaba 1e1722c 212aa1a 1e1722c 212aa1a 1e1722c 212aa1a 1e1722c 212aa1a 1e1722c 212aa1a 1e1722c 212aa1a 1e1722c 212aa1a 1e1722c 212aa1a 1e1722c 212aa1a 1e1722c 212aa1a 1e1722c 212aa1a 1e1722c 60661a8 0875f5d 60661a8 bd6e3c3 60661a8 212aa1a 60661a8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# -*- coding: utf-8 -*-
"""app
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1coUNcj1aXJN8fGu2dsf64GKHF5CoMNuJ
*`Uma Namboothiripad Final Project*
"""
import streamlit as st
import pandas as pd
import urllib
import pickle
st.title("Do your Employees Want to Leave You?")
st.markdown("Some of the factors below greatly impact if an employee with leave the organization")
"""Enter the employee's age"""
Age = st.number_input('Age:')
"""Please enter the numeric numbers for the following marital status of your employee. 0 = Divorced, 1= Married, 2= Single"""
MaritalStatus = st.number_input('Marital Status:')
"""Please enter the numeric numbers for the following job levels of your employee. 0 = Entry Level, 1= Intermediate, 2= Mid-Level, 3 = Assistant or Associate Director, 4 = Director"""
JobLevel=st.number_input('JobLevel:')
"""Enter the employee's monthly income from this job"""
MonthlyIncome = st.number_input('MonthlyIncome:')
"""Enter how many years the employee has worked full-time"""
TotalWorkingYears = st.number_input('TotalWorkingYears')
"""Enter how many years the employee has worked at this company"""
YearsAtCompany = st.number_input('YearsAtCompany')
"""Enter how many years the employee has last received a promotion"""
YearsSinceLastPromotion = st.number_input('YearsSinceLastPromotion')
"""Enter how many years the employee has worked for their current manager"""
YearsWithCurrManager = st.number_input('YearsWithCurrManager')
dataurl = 'https://colab.research.google.com/drive/1-8ctPDO-F1GYjztowygbfzJI2i5vZT9J?usp=sharing'
@st.cache(persist=True)
def load_data():
data_url = urllib.request.urlopen('https://colab.research.google.com/drive/1-8ctPDO-F1GYjztowygbfzJI2i5vZT9J?usp=sharing')
url="https://huggingface.co/datasets/namb0010/Turnover/raw/main/finalproject.csv"
df = pd.read_csv(url)
if st.button("Predict"):
picklefile = open("model.pkl", "rb")
model = pickle.load(picklefile)
X_test3 = [['Age', 'JobLevel', 'MaritalStatus', 'MonthlyIncome', 'TotalWorkingYears', 'YearsAtCompany', 'YearsSinceLastPromotion', 'YearsWithCurrManager']]
Y = model.predict(X_test3)
if Y== 0:
st.success('Congrats (or not) they will be sticking around longer')
elif Y == 1:
st.error( 'Plan the farewell party') |