Skip to content

Commit 703f947

Browse files
committed
! mse round in graphics
1 parent a0e8631 commit 703f947

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

execute.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ def experiment(lin_reg_cfg, visualise_prediction=True):
99
linreg_dataset = LinRegDataset()(lin_reg_cfg.dataframe_path)
1010

1111
predictions = lin_reg_model(linreg_dataset["inputs"])
12-
error = round(MSE(predictions, linreg_dataset["targets"]), 2)
12+
error = MSE(predictions, linreg_dataset["targets"])
1313

1414
if visualise_prediction:
1515
Visualisation.visualise_predicted_trace(
1616
predictions,
1717
linreg_dataset["inputs"],
1818
linreg_dataset["targets"],
19-
plot_title=f"Полином степени {len(lin_reg_cfg.base_functions)}; MSE = {error}",
19+
plot_title=f"Полином степени {len(lin_reg_cfg.base_functions)}; MSE = {round(error, 2)}",
2020
)
2121

2222

@@ -26,6 +26,7 @@ def experiment(lin_reg_cfg, visualise_prediction=True):
2626
degrees = [1, 8, 100]
2727
for elem in degrees:
2828
lin_reg_cfg.update(
29-
base_functions=[lambda x, degree=i: x**degree for i in range(1 + elem)]
29+
# we have f1, f2, ... fn functions, about f0 in __plan_matrix
30+
base_functions=[lambda x, degree=i: x**degree for i in range(1, 1 + elem)]
3031
)
3132
experiment(lin_reg_cfg, visualise_prediction=True)

0 commit comments

Comments
 (0)