Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,19 +3,20 @@ import pandas as pd
|
|
3 |
from joblib import load
|
4 |
|
5 |
|
6 |
-
def humands(Monthlyincome,Age,TotalWorkingYears,
|
7 |
model = load('modelo_entrenado.pkl')
|
8 |
df = pd.DataFrame.from_dict(
|
9 |
{
|
10 |
"Monthlyincome" : [Monthlyincome],
|
11 |
"Age" : [Age],
|
12 |
"TotalWorkingYears" : [TotalWorkingYears],
|
13 |
-
"
|
|
|
14 |
"DistanceFromHome" : [DistanceFromHome],
|
15 |
"OverTime_Yes" : [0 if Overtime else 1],
|
16 |
"OverTime_No" : [0 if not Overtime else 1],
|
17 |
"YearsAtCompany" : [YearsAtCompany],
|
18 |
-
"MonthlyRate" : [
|
19 |
"NumCompaniesWorked" : [NumCompaniesWorked],
|
20 |
"PercentSalaryHike" : [0],
|
21 |
"YearsInCurrentRole" : [0],
|
@@ -75,12 +76,15 @@ def humands(Monthlyincome,Age,TotalWorkingYears,DailyRate,HourlyRare,DistanceFro
|
|
75 |
return predicted
|
76 |
|
77 |
iface = gr.Interface(
|
78 |
-
|
79 |
[
|
80 |
-
gr.inputs.Slider(
|
81 |
-
gr.inputs.Slider(
|
82 |
-
gr.inputs.Slider(
|
83 |
-
gr.inputs.Slider(
|
|
|
|
|
|
|
84 |
|
85 |
],
|
86 |
|
|
|
3 |
from joblib import load
|
4 |
|
5 |
|
6 |
+
def humands(Monthlyincome,Age,TotalWorkingYears,DistanceFromHome,Overtime,YearsAtCompany,NumCompaniesWorked):
|
7 |
model = load('modelo_entrenado.pkl')
|
8 |
df = pd.DataFrame.from_dict(
|
9 |
{
|
10 |
"Monthlyincome" : [Monthlyincome],
|
11 |
"Age" : [Age],
|
12 |
"TotalWorkingYears" : [TotalWorkingYears],
|
13 |
+
"DailyRate" : [Monthlyincome*2/30],
|
14 |
+
"HourlyRate" : [Monthlyincome*2/1640],
|
15 |
"DistanceFromHome" : [DistanceFromHome],
|
16 |
"OverTime_Yes" : [0 if Overtime else 1],
|
17 |
"OverTime_No" : [0 if not Overtime else 1],
|
18 |
"YearsAtCompany" : [YearsAtCompany],
|
19 |
+
"MonthlyRate" : [Monthlyincome*2],
|
20 |
"NumCompaniesWorked" : [NumCompaniesWorked],
|
21 |
"PercentSalaryHike" : [0],
|
22 |
"YearsInCurrentRole" : [0],
|
|
|
76 |
return predicted
|
77 |
|
78 |
iface = gr.Interface(
|
79 |
+
humands,
|
80 |
[
|
81 |
+
gr.inputs.Slider(1000,20000,label="Ingresos mensuales del trabajador"),
|
82 |
+
gr.inputs.Slider(18,70,label="Edad del trabajador"),
|
83 |
+
gr.inputs.Slider(0,40,label="Total de años trabajados del trabajador"),
|
84 |
+
gr.inputs.Slider(0,100,label="Distancia del trabajo al domicilio en Km"),
|
85 |
+
gr.inputs.Checkbox(label="¿Realiza horas extas?"),
|
86 |
+
gr.inputs.Slider(0,40,label="Años del trabajador en la empresa"),
|
87 |
+
gr.inputs.Slider(0,40,label="Numero de empresas en las que ha estado el trabajador"),
|
88 |
|
89 |
],
|
90 |
|