Nifdi01 commited on
Commit
fb5a1bd
1 Parent(s): bd5c3ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -54,11 +54,11 @@ st.write(coeff_df)
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
- formatted_intercept = f'{regressor.intercept_:.2e}'
62
 
63
  latex_equation = r'''
64
  Our Equation: {} + {}
@@ -70,6 +70,7 @@ st.latex(latex_equation)
70
 
71
 
72
 
 
73
  def calculate_polynomial_value(coefficients, X, intercept):
74
  result = sum(coeff * (X ** i) for i, coeff in enumerate(coefficients))
75
  return result + intercept
 
54
 
55
 
56
  coefficients = [i for i in regressor.coef_]
57
+ formatted_coefficients = [format(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
+ formatted_intercept = format(regressor.intercept_, ".2e")
62
 
63
  latex_equation = r'''
64
  Our Equation: {} + {}
 
70
 
71
 
72
 
73
+
74
  def calculate_polynomial_value(coefficients, X, intercept):
75
  result = sum(coeff * (X ** i) for i, coeff in enumerate(coefficients))
76
  return result + intercept