modificacion de interface
Browse files
app.py
CHANGED
|
@@ -38,10 +38,16 @@ diccionario_operaciones = {
|
|
| 38 |
|
| 39 |
}
|
| 40 |
|
| 41 |
-
|
| 42 |
-
'1 -
|
| 43 |
-
'
|
| 44 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
}
|
| 46 |
|
| 47 |
#Funciones
|
|
@@ -57,7 +63,7 @@ def procesarDatos(valor):
|
|
| 57 |
|
| 58 |
formulario = {
|
| 59 |
'recency_t': str(valor[0]),
|
| 60 |
-
'Avg_dias_t': str(
|
| 61 |
'distancia_t': str(valor[2]),
|
| 62 |
'total_min_t': str(valor[3]),
|
| 63 |
'num_reincidencia_t': str(valor[4]),
|
|
@@ -102,11 +108,8 @@ def procesarDatos(valor):
|
|
| 102 |
|
| 103 |
|
| 104 |
# print(resultado)
|
| 105 |
-
#dataNew.to_csv(r'C:\Users\Jartemio\Desktop\Saturdays\repositorioPruebaHuggingface\export_dataframe.csv', index=False, header=True)
|
| 106 |
st.success(cluster_dict[dataNew["Cluster"].iloc[-1]]["descripcion"]+"✅")
|
| 107 |
return ""
|
| 108 |
-
#list1 = [0,1, 2, 3, 4, 5, 6,7]
|
| 109 |
-
#return cluster_dict[random.choice(list1)]["descripcion"]
|
| 110 |
|
| 111 |
#Interface
|
| 112 |
|
|
@@ -118,15 +121,15 @@ with col3:
|
|
| 118 |
|
| 119 |
col1, col2, col3 = st.columns(3)
|
| 120 |
with col1:
|
| 121 |
-
recency = st.number_input('
|
| 122 |
|
| 123 |
with col2:
|
| 124 |
#avg_dias = st.number_input('Promedio de dias que se usa mibici',value=0.00)
|
| 125 |
avg_dias = option = st.selectbox(
|
| 126 |
-
'
|
| 127 |
-
(
|
| 128 |
with col3:
|
| 129 |
-
total_min = st.number_input('Distancia que recorre en km',value=0.
|
| 130 |
|
| 131 |
col1, col2, col3 = st.columns(3)
|
| 132 |
with col1:
|
|
|
|
| 38 |
|
| 39 |
}
|
| 40 |
|
| 41 |
+
diccionario_Avg_dias_t = {
|
| 42 |
+
'1 - 5 dias': 2.5,
|
| 43 |
+
'5 - 10 dias': 7.5,
|
| 44 |
+
'10 - 15 dias': 12.5,
|
| 45 |
+
'15 - 20 dias': 17.5,
|
| 46 |
+
'20 - 25 dias': 22.5,
|
| 47 |
+
'25 - 30 dias': 27.5,
|
| 48 |
+
'30 - 35 dias': 32.5,
|
| 49 |
+
'35 - 40 dias': 37.5,
|
| 50 |
+
'40 dias en adelante': 45
|
| 51 |
}
|
| 52 |
|
| 53 |
#Funciones
|
|
|
|
| 63 |
|
| 64 |
formulario = {
|
| 65 |
'recency_t': str(valor[0]),
|
| 66 |
+
'Avg_dias_t': str(diccionario_Avg_dias_t[valor[1]]),
|
| 67 |
'distancia_t': str(valor[2]),
|
| 68 |
'total_min_t': str(valor[3]),
|
| 69 |
'num_reincidencia_t': str(valor[4]),
|
|
|
|
| 108 |
|
| 109 |
|
| 110 |
# print(resultado)
|
|
|
|
| 111 |
st.success(cluster_dict[dataNew["Cluster"].iloc[-1]]["descripcion"]+"✅")
|
| 112 |
return ""
|
|
|
|
|
|
|
| 113 |
|
| 114 |
#Interface
|
| 115 |
|
|
|
|
| 121 |
|
| 122 |
col1, col2, col3 = st.columns(3)
|
| 123 |
with col1:
|
| 124 |
+
recency = st.number_input('Dias recientes que ha usado MIBICI',min_value=1, max_value=30, value=1)
|
| 125 |
|
| 126 |
with col2:
|
| 127 |
#avg_dias = st.number_input('Promedio de dias que se usa mibici',value=0.00)
|
| 128 |
avg_dias = option = st.selectbox(
|
| 129 |
+
'Dias que usa MIBICI usualmente',
|
| 130 |
+
(diccionario_Avg_dias_t))
|
| 131 |
with col3:
|
| 132 |
+
total_min = st.number_input('Distancia que recorre en km', min_value=0.5, max_value=20.0, value=0.5, step=0.5 )
|
| 133 |
|
| 134 |
col1, col2, col3 = st.columns(3)
|
| 135 |
with col1:
|