Skip to content

Commit 27c6972

Browse files
committed
Added Todos with numerations to the first part
1 parent 12241f6 commit 27c6972

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

src/regularization.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,36 @@ def set_up_point_matrix(axis_x: np.ndarray, degree: int) -> np.ndarray:
2424
np.ndarray: The polynomial point matrix A.
2525
"""
2626
mat_a = np.zeros((len(axis_x), degree))
27-
# TODO implement me!
27+
# TODO 1.1.1 implement me!
2828
return mat_a
2929

3030

3131
if __name__ == "__main__":
3232
b_noise_p = pandas.read_csv("./data/noisy_signal.tab", header=None)
33-
b_noise = np.asarray(b_noise_p)
33+
b_noise = np.asarray(b_noise_p) # This is the artificial data we work with
3434

3535
x_axis = np.linspace(0, 1, num=len(b_noise))
3636

3737
plt.plot(x_axis, b_noise, ".", label="b_noise")
3838
plt.show()
3939

4040
# TODO put your code here!
41+
42+
# 1.1 Regression
43+
44+
# 1.1.2 Create the point-matrix A for n=2
45+
46+
# 1.1.3 Calculate the estimated coefficients for the polynomial
47+
# You can use np.linalg.pinv to compute the Pseudo-Inverse
48+
49+
# 1.1.4 Plot the original data as well as the estimated polynomial by evaluating it.
50+
51+
# 1.2 Higher order Polynomial
52+
53+
# 1.2.1 Create the point-matrix A for n=300
54+
55+
# 1.2.2 Calculate the estimated coefficients for the polynomial
56+
57+
# 1.2.3 Plot the original data as well as the estimated polynomial by evaluating it.
58+
59+
# 1.3 Regularization

0 commit comments

Comments
 (0)