Spaces:
Sleeping
Sleeping
fschwartzer
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -68,17 +68,13 @@ def find_best_transformations(file):
|
|
68 |
best_combination = transformation_combo
|
69 |
best_model = model
|
70 |
|
71 |
-
#
|
72 |
equation = f"y = {best_model.intercept_:.4f} " + " + ".join(
|
73 |
[f"({coef:.4f}) * {trans}" for coef, trans in zip(best_model.coef_, X.columns)]
|
74 |
)
|
75 |
transformation_info = dict(zip(X.columns, best_combination))
|
76 |
|
77 |
-
return
|
78 |
-
"Equação": equation,
|
79 |
-
"Transformações": transformation_info,
|
80 |
-
"R2_Score": best_score,
|
81 |
-
}
|
82 |
|
83 |
# Configuração da interface Gradio
|
84 |
iface = gr.Interface(
|
@@ -94,4 +90,4 @@ iface = gr.Interface(
|
|
94 |
)
|
95 |
|
96 |
# Executa a interface Gradio com link público
|
97 |
-
iface.launch(share=True)
|
|
|
68 |
best_combination = transformation_combo
|
69 |
best_model = model
|
70 |
|
71 |
+
# Formata a saída para cada campo esperado
|
72 |
equation = f"y = {best_model.intercept_:.4f} " + " + ".join(
|
73 |
[f"({coef:.4f}) * {trans}" for coef, trans in zip(best_model.coef_, X.columns)]
|
74 |
)
|
75 |
transformation_info = dict(zip(X.columns, best_combination))
|
76 |
|
77 |
+
return equation, transformation_info, best_score
|
|
|
|
|
|
|
|
|
78 |
|
79 |
# Configuração da interface Gradio
|
80 |
iface = gr.Interface(
|
|
|
90 |
)
|
91 |
|
92 |
# Executa a interface Gradio com link público
|
93 |
+
iface.launch(share=True)
|