You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/Projects/2025/Project1/html/._Project1-bs000.html
+9-7Lines changed: 9 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -175,18 +175,20 @@ <h4>September 2</h4>
175
175
<h2id="preamble-note-on-writing-reports-using-reference-material-ai-and-other-tools" class="anchor">Preamble: Note on writing reports, using reference material, AI and other tools </h2>
176
176
177
177
<p>We want you to answer the three different projects by handing in
178
-
reports written like a standard scientific/technical report. The links
179
-
at <ahref="https://github.com/CompPhysics/MachineLearning/tree/master/doc/Projects" target="_self"><tt>https://github.com/CompPhysics/MachineLearning/tree/master/doc/Projects</tt></a>
180
-
Furthermore, at the same link,
181
-
you can find examples of previous reports. How to write reports will
182
-
also be discussed during the various lab sessions. Please do ask us if you are in doubt.
178
+
reports written like a standard scientific/technical report. The
Copy file name to clipboardExpand all lines: doc/Projects/2025/Project1/html/._Project1-bs001.html
+54-41Lines changed: 54 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -154,7 +154,7 @@
154
154
<h2id="regression-analysis-and-resampling-methods" class="anchor">Regression analysis and resampling methods </h2>
155
155
156
156
<p>The main aim of this project is to study in more detail various
157
-
regression methods, including the Ordinary Least Squares (OLS) method.
157
+
regression methods, including Ordinary Least Squares (OLS) reegression, Ridge regression and LASSO regression.
158
158
In addition to the scientific part, in this course we want also to
159
159
give you an experience in writing scientific reports.
160
160
</p>
@@ -170,27 +170,26 @@ <h2 id="regression-analysis-and-resampling-methods" class="anchor">Regression an
170
170
171
171
<p>Our first step will be to perform an OLS regression analysis of this
172
172
function, trying out a polynomial fit with an \( x \) dependence of the
173
-
form \( [x,x^2,\dots] \). We can use a uniform distribution to set up the
173
+
form \( [x,x^2,\dots] \). You can use a uniform distribution to set up the
174
174
arrays of values for \( x \in [-1,1] \), or alternatively use a fixed step size.
175
-
Thereafter we will repeat much of the
176
-
same procedure using the Ridge and Lasso regression methods,
177
-
introducing thus a dependence on the hyperparameter (penalty) \( \lambda \).
175
+
Thereafter we will repeat many of the same steps when using the Ridge and Lasso regression methods,
176
+
introducing thereby a dependence on the hyperparameter (penalty) \( \lambda \).
178
177
</p>
179
178
180
179
<p>We will also include bootstrap as a resampling technique in order to
181
180
study the so-called <b>bias-variance tradeoff</b>. After that we will
182
-
include the cross-validation technique.
181
+
include the so-called cross-validation technique.
183
182
</p>
184
183
<h3id="part-a-ordinary-least-square-ols-for-the-runge-function" class="anchor">Part a : Ordinary Least Square (OLS) for the Runge function </h3>
185
184
186
-
<p>We will generate our own dataset for a function
185
+
<p>We will generate our own dataset for abovementioned function
187
186
\( \mathrm{Runge}(x) \) function with \( x\in [-1,1] \). You should explore also the addition
188
187
of an added stochastic noise to this function using the normal
189
188
distribution \( N(0,1) \).
190
189
</p>
191
190
192
191
<p><em>Write your own code</em> (using for example the pseudoinverse function <b>pinv</b> from <b>Numpy</b> ) and perform a standard <b>ordinary least square regression</b>
193
-
analysis using polynomials in \( x \) up to order \( 15 \). Explore the dependence on the number of data points and the polynomial degree.
192
+
analysis using polynomials in \( x \) up to order \( 15 \) or higher. Explore the dependence on the number of data points and the polynomial degree.
<h3id="part-b-adding-ridge-regression-for-the-runge-function" class="anchor">Part b: Adding Ridge regression for the Runge function </h3>
244
243
245
244
<p>Write your own code for the Ridge method as done in the previous
246
-
exercise. The lecture notes from week 35 and 36 contain more information. Furthermore, the exercise from week 36 is something you can reuse here.
245
+
exercise. The lecture notes from week 35 and 36 contain more information. Furthermore, the results from the exercise set from week 36 is something you can reuse here.
247
246
</p>
248
247
249
248
<p>Perform the same analysis as you did in the previous exercise but now for different values of \( \lambda \). Compare and
250
-
analyze your results with those obtained in part a) with the ordinary least squares method. Study the
249
+
analyze your results with those obtained in part a) with the OLS method. Study the
251
250
dependence on \( \lambda \).
252
251
</p>
253
252
<h3id="part-c-writing-your-own-gradient-descent-code" class="anchor">Part c: Writing your own gradient descent code </h3>
<p>The answer to this exercise should be included in the theory part of the report. This exercise is also part of the weekly exercises of week 38.
365
-
Explain what the terms mean and discuss their interpretations.
371
+
<p><b>Important note</b>: Since the function \( f(x) \) is unknown, in order to be able to evalute the bias, we replace \( f(\boldsymbol{x}) \) in the expression for the bias with \( \boldsymbol{y} \). </p>
372
+
373
+
<p>The answer to this exercise should be included in the theory part of
374
+
the report. This exercise is also part of the weekly exercises of
375
+
week 38. Explain what the terms mean and discuss their
376
+
interpretations.
366
377
</p>
367
378
368
379
<p>Perform then a bias-variance analysis of the Runge function by
resampling technique, the so-called cross-validation method.
381
392
</p>
382
393
383
-
<p>Implement the \( k \)-fold cross-validation algorithm (feel free to use the functionality of <b>Scikit-Learn</b> or write your own code) and evaluate again the MSE function resulting
384
-
from the test folds.
394
+
<p>Implement the \( k \)-fold cross-validation algorithm (feel free to use
395
+
the functionality of <b>Scikit-Learn</b> or write your own code) and
396
+
evaluate again the MSE function resulting from the test folds.
385
397
</p>
386
398
387
399
<p>Compare the MSE you get from your cross-validation code with the one
388
-
you got from your <b>bootstrap</b> code. Comment your results. Try \( 5-10 \)
389
-
folds.
400
+
you got from your <b>bootstrap</b> code from the previous exercise. Comment and interpret your results.
390
401
</p>
391
402
392
-
<p>In addition to using the ordinary least squares method, you should include both Ridge and Lasso regression in the analysis. </p>
403
+
<p>In addition to using the ordinary least squares method, you should
404
+
include both Ridge and Lasso regression in the final analysis.
405
+
</p>
393
406
<h2id="background-literature" class="anchor">Background literature </h2>
Copy file name to clipboardExpand all lines: doc/Projects/2025/Project1/html/Project1-bs.html
+9-7Lines changed: 9 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -175,18 +175,20 @@ <h4>September 2</h4>
175
175
<h2id="preamble-note-on-writing-reports-using-reference-material-ai-and-other-tools" class="anchor">Preamble: Note on writing reports, using reference material, AI and other tools </h2>
176
176
177
177
<p>We want you to answer the three different projects by handing in
178
-
reports written like a standard scientific/technical report. The links
179
-
at <ahref="https://github.com/CompPhysics/MachineLearning/tree/master/doc/Projects" target="_self"><tt>https://github.com/CompPhysics/MachineLearning/tree/master/doc/Projects</tt></a>
180
-
Furthermore, at the same link,
181
-
you can find examples of previous reports. How to write reports will
182
-
also be discussed during the various lab sessions. Please do ask us if you are in doubt.
178
+
reports written like a standard scientific/technical report. The
0 commit comments