Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -54,6 +54,8 @@ st.write(coeff_df)
|
|
54 |
|
55 |
|
56 |
coefficients = [i for i in regressor.coef_]
|
|
|
|
|
57 |
terms = [f'{coeff}X^{i}' for i, coeff in enumerate(coefficients) if coeff != 0]
|
58 |
|
59 |
latex_equation = r'''
|
@@ -61,7 +63,8 @@ Our Equation: {} + {}
|
|
61 |
'''.format(regressor.intercept_, ' + '.join(terms))
|
62 |
|
63 |
st.write("### Polynomial Equation")
|
64 |
-
st.latex(latex_equation)
|
|
|
65 |
|
66 |
|
67 |
def calculate_polynomial_value(coefficients, X, intercept):
|
|
|
54 |
|
55 |
|
56 |
coefficients = [i for i in regressor.coef_]
|
57 |
+
formatted_coefficients = [f'{coeff:.2e}' for coeff in coefficients if coeff != 0]
|
58 |
+
|
59 |
terms = [f'{coeff}X^{i}' for i, coeff in enumerate(coefficients) if coeff != 0]
|
60 |
|
61 |
latex_equation = r'''
|
|
|
63 |
'''.format(regressor.intercept_, ' + '.join(terms))
|
64 |
|
65 |
st.write("### Polynomial Equation")
|
66 |
+
st.latex(latex_equation.format(regressor.intercept_, ' + '.join(formatted_coefficients)))
|
67 |
+
|
68 |
|
69 |
|
70 |
def calculate_polynomial_value(coefficients, X, intercept):
|