import streamlit as st import numpy as np import pickle import streamlit.components.v1 as components from sklearn.preprocessing import LabelEncoder le = LabelEncoder() # Load the pickled model def load_model(): return pickle.load(open('Employee_Turnover_prognosis_RandomForest.pkl', 'rb')) # Function for model prediction def model_prediction(model, features): predicted = str(model.predict(features)[0]) return predicted def transform(text): text = le.fit_transform(text) return text[0] def app_design(): # Add input fields for High, Open, and Low values image = '14.png' st.image(image, use_column_width=True) st.subheader("Enter the following values:") Stag = st.number_input("Stag") Gender = st.selectbox('Gender',('Male','Female')) if Gender == 'Male': Gender = 1 elif Gender == 'Female': Gender = 0 Age = st.number_input("Age") Industry = st.text_input("Industry") Industry=transform([Industry]) Profession = st.text_input("Profession") Profession=transform([Profession]) Traffic = st.text_input("Traffic") Traffic=transform([Traffic]) Coach = st.selectbox('Coach',('Yes','No')) if Coach == 'Yes': Coach = 1 elif Coach == 'No': Coach = 0 Head_gender = st.selectbox("Head Gender",('Male','Female')) if Head_gender == 'Male': Head_gender = 0 elif Head_gender == 'Female': Head_gender = 1 Greywage = st.text_input("Greywage") Greywage=transform([Greywage]) Way = st.text_input("Way") Way=transform([Way]) Extraversion = st.number_input("Extraversion") Independ = st.number_input("Independ") Selfcontrol = st.number_input("Self-control") Anxiety = st.number_input("Anxiety") Novator = st.number_input("Novator") # Create a feature list from the user inputs features = [[Stag,Gender,Age,Industry,Profession,Traffic,Coach,Head_gender,Greywage,Way,Extraversion,Independ,Selfcontrol,Anxiety,Novator]] # Load the model model = load_model() # Make a prediction when the user clicks the "Predict" button if st.button('Predict Turnover'): predicted_value = model_prediction(model, features) st.success(f"The Employee Turnover is: {predicted_value}") def about_hidevs(): components.html("""
🔍 Seeking the perfect job? HiDevs Community is your gateway to career success in the tech industry. Explore free expert courses, job-seeking support, and career transformation tips.
đź’Ľ We offer an upskill program in Gen AI, Data Science, Machine Learning, and assist startups in adopting Gen AI at minimal development costs.
🆓 Best of all, everything we offer is completely free! We are dedicated to helping society.
Book free of cost 1:1 mentorship on any topic of your choice — topmate
✨ We dedicate over 30 minutes to each applicant’s resume, LinkedIn profile, mock interview, and upskill program. If you’d like our guidance, check out our services here
đź’ˇ Join us now, and turbocharge your career!