Update app.py
Browse files
app.py
CHANGED
@@ -520,6 +520,7 @@ def fit_and_optimize_model():
|
|
520 |
if 'rsm' not in globals():
|
521 |
return None, None, None, None, None, None, None, None, None, "Error: Carga los datos primero."
|
522 |
|
|
|
523 |
model_completo, pareto_completo = rsm.fit_model()
|
524 |
model_simplificado, pareto_simplificado = rsm.fit_simplified_model()
|
525 |
optimization_table = rsm.optimize()
|
@@ -535,7 +536,7 @@ def fit_and_optimize_model():
|
|
535 |
equation_formatted = equation.replace(" + ", "<br>+ ").replace(" ** ", "^").replace("*", " 脳 ")
|
536 |
equation_formatted = f"### Ecuaci贸n del Modelo Simplificado:<br>{equation_formatted}"
|
537 |
|
538 |
-
return model_completo.summary().tables[0].as_html(), pareto_completo, model_completo.summary().tables[1].as_html(), model_simplificado.summary().as_html(), pareto_simplificado, equation_formatted, optimization_table, prediction_table, contribution_table, anova_table, rsm_plots, gr.update(visible=True)
|
539 |
|
540 |
def generate_rsm_plot(plot_index):
|
541 |
if 'rsm_plots' not in globals() or not rsm_plots:
|
|
|
520 |
if 'rsm' not in globals():
|
521 |
return None, None, None, None, None, None, None, None, None, "Error: Carga los datos primero."
|
522 |
|
523 |
+
global rsm_plots
|
524 |
model_completo, pareto_completo = rsm.fit_model()
|
525 |
model_simplificado, pareto_simplificado = rsm.fit_simplified_model()
|
526 |
optimization_table = rsm.optimize()
|
|
|
536 |
equation_formatted = equation.replace(" + ", "<br>+ ").replace(" ** ", "^").replace("*", " 脳 ")
|
537 |
equation_formatted = f"### Ecuaci贸n del Modelo Simplificado:<br>{equation_formatted}"
|
538 |
|
539 |
+
return model_completo.summary().tables[0].as_html(), pareto_completo, model_completo.summary().tables[1].as_html(), model_simplificado.summary().as_html(), pareto_simplificado, equation_formatted, optimization_table, prediction_table, contribution_table, anova_table, rsm_plots, gr.update(visible=True, maximum=len(rsm_plots) -1)
|
540 |
|
541 |
def generate_rsm_plot(plot_index):
|
542 |
if 'rsm_plots' not in globals() or not rsm_plots:
|