@@ -37,7 +37,7 @@ def set_up_point_matrix(axis_x: np.ndarray, degree: int) -> np.ndarray:
3737 plt .plot (x_axis , b_noise , "." , label = "b_noise" )
3838 plt .show ()
3939
40- # TODO put your code here!
40+ # TODO put your code for Part 1 here!
4141
4242 # 1.1 Regression
4343
@@ -48,6 +48,8 @@ def set_up_point_matrix(axis_x: np.ndarray, degree: int) -> np.ndarray:
4848
4949 # 1.1.4 Plot the original data as well as the estimated polynomial by evaluating it.
5050
51+
52+
5153 # 1.2 Higher order Polynomial
5254
5355 # 1.2.1 Create the point-matrix A for n=300
@@ -56,4 +58,35 @@ def set_up_point_matrix(axis_x: np.ndarray, degree: int) -> np.ndarray:
5658
5759 # 1.2.3 Plot the original data as well as the estimated polynomial by evaluating it.
5860
61+
62+
5963 # 1.3 Regularization
64+
65+ # 1.3.1 Compute the SVD of A
66+
67+ # 1.3.2 Compute the filter matrix
68+
69+ # 1.3.3 Estimate the coefficients by applying regularization
70+
71+ # 1.3.4 Plot your results
72+
73+ #----------------------------------------------------------------------------------------#
74+ # Optional Task 1.4 Model Complexity
75+
76+ # For every degree from 1 to 20:
77+
78+ # 1.4.1 Set up the point matrix for the current degree
79+
80+ # 1.4.2 Estimate the coefficients for the polynomial via the pseudoinverse
81+
82+ # 1.4.3 Compute the predictions by evaluating the estimated polynomial at the x-values
83+
84+ # 1.4.4 Compute the MSE between the predictions and the original b-values
85+
86+ # 1.4.5 Plot the MSE-error against the degree
87+
88+ # 1.4.6 Take a look at the graph with all 20 MSE's and see if there is a link between degree and MSE
89+ # Estimate the optimal degree of polynomial and fit the polynomial with this new degree
90+ # --> so perform the usual steps but only once with the optimal degree
91+
92+ # Plot the result
0 commit comments