de-Rodrigo commited on
Commit
357377d
1 Parent(s): 5dd334e
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1286,7 +1286,7 @@ def run_model(model_name):
1286
  )
1287
  # Transponer la matriz para alinear correctamente los ejes
1288
  # Transponer y limpiar valores inv谩lidos (NaN, inf, -inf)
1289
- heatmap_data = heat_stat.T
1290
  heatmap_data = np.nan_to_num(heat_stat.T, nan=0.0, posinf=0.0, neginf=0.0)
1291
 
1292
  # Definir el color mapper
@@ -1509,6 +1509,7 @@ def run_model(model_name):
1509
 
1510
  # Rango real de los datos
1511
  df_heatmap = df_heatmap_base.copy()
 
1512
  x_min, x_max = df_heatmap[x_comp].min(), df_heatmap[x_comp].max()
1513
  y_min, y_max = df_heatmap[y_comp].min(), df_heatmap[y_comp].max()
1514
 
@@ -1521,8 +1522,9 @@ def run_model(model_name):
1521
  grid_size = st.slider("Grid size (resoluci贸n del heatmap)", min_value=10, max_value=100, value=40, step=5)
1522
  x_bins = np.linspace(x_min, x_max, grid_size + 1)
1523
  y_bins = np.linspace(y_min, y_max, grid_size + 1)
1524
- x_range = (x_min - padding, x_max + padding)
1525
- y_range = (y_min - padding, y_max + padding)
 
1526
 
1527
 
1528
  df_heatmap["x"] = df_heatmap[x_comp]
@@ -1542,7 +1544,7 @@ def run_model(model_name):
1542
  df_heatmap['x'], df_heatmap['y'], df_heatmap[selected_feature],
1543
  statistic='mean', bins=[x_bins, y_bins]
1544
  )
1545
- heatmap_data = heat_stat.T
1546
  heatmap_data = np.nan_to_num(heat_stat.T, nan=0.0, posinf=0.0, neginf=0.0)
1547
 
1548
  cmap = plt.get_cmap("RdYlGn")
 
1286
  )
1287
  # Transponer la matriz para alinear correctamente los ejes
1288
  # Transponer y limpiar valores inv谩lidos (NaN, inf, -inf)
1289
+ # heatmap_data = heat_stat.T
1290
  heatmap_data = np.nan_to_num(heat_stat.T, nan=0.0, posinf=0.0, neginf=0.0)
1291
 
1292
  # Definir el color mapper
 
1509
 
1510
  # Rango real de los datos
1511
  df_heatmap = df_heatmap_base.copy()
1512
+ # Rango real de los datos
1513
  x_min, x_max = df_heatmap[x_comp].min(), df_heatmap[x_comp].max()
1514
  y_min, y_max = df_heatmap[y_comp].min(), df_heatmap[y_comp].max()
1515
 
 
1522
  grid_size = st.slider("Grid size (resoluci贸n del heatmap)", min_value=10, max_value=100, value=40, step=5)
1523
  x_bins = np.linspace(x_min, x_max, grid_size + 1)
1524
  y_bins = np.linspace(y_min, y_max, grid_size + 1)
1525
+
1526
+ # Usar los mismos valores para figure y image
1527
+ x_range, y_range = (x_min, x_max), (y_min, y_max)
1528
 
1529
 
1530
  df_heatmap["x"] = df_heatmap[x_comp]
 
1544
  df_heatmap['x'], df_heatmap['y'], df_heatmap[selected_feature],
1545
  statistic='mean', bins=[x_bins, y_bins]
1546
  )
1547
+ # heatmap_data = heat_stat.T
1548
  heatmap_data = np.nan_to_num(heat_stat.T, nan=0.0, posinf=0.0, neginf=0.0)
1549
 
1550
  cmap = plt.get_cmap("RdYlGn")