update on project description
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
"source": [
|
||||
"<!-- HTML file automatically generated from DocOnce source (https://github.com/doconce/doconce/)\n",
|
||||
"doconce format html Project1.do.txt -->\n",
|
||||
"<!-- dom:TITLE: Project 1 on Machine Learning, deadline October 6 (midnight), 2025 -->"
|
||||
"<!-- dom:TITLE: Project 1 on Machine Learning, deadline October 6 (midnight), 2025 -->\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -20,9 +20,34 @@
|
||||
},
|
||||
"source": [
|
||||
"# Project 1 on Machine Learning, deadline October 6 (midnight), 2025\n",
|
||||
"\n",
|
||||
"**Data Analysis and Machine Learning FYS-STK3155/FYS4155**, University of Oslo, Norway\n",
|
||||
"\n",
|
||||
"Date: **September 2**"
|
||||
"Date: **September 2**\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "beb333e3",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Deliverables\n",
|
||||
"\n",
|
||||
"First, join a group in canvas with your group partners. Pick an avaliable group for Project 1 in the \"People\" page.\n",
|
||||
"\n",
|
||||
"In canvas, deliver as a group and include:\n",
|
||||
"\n",
|
||||
"- A PDF of your report which follows the guidelines covered below and in the week 39 exercises. Additional requirements include:\n",
|
||||
" - It should be around 5000 words, use the word counter in Overleaf for this. This often corresponds to 10-12 pages. References and appendices are excluded from the word count\n",
|
||||
" - It should include around 10-15 figures. You can include more figures in appendices and/or as supplemental material in your repository.\n",
|
||||
"- A comment linking to your github repository (or folder in one of your github repositories) for this project. The repository must include\n",
|
||||
" - A PDF file of the report\n",
|
||||
" - A folder named Code, where you put python files for your functions and notebooks for reproducing your results. Remember to use a seed for generating random data and for train-test splits when generating final results.\n",
|
||||
" - A README file with\n",
|
||||
" - the name of the group members\n",
|
||||
" - a short description of the project\n",
|
||||
" - a description of how to install the required packages to run your code from a requirements.txt file or similar (such as a plain text description)\n",
|
||||
" - names and descriptions of the various notebooks in the Code folder and the results they produce\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -35,7 +60,7 @@
|
||||
"## Preamble: Note on writing reports, using reference material, AI and other tools\n",
|
||||
"\n",
|
||||
"We want you to answer the three different projects by handing in\n",
|
||||
"reports written like a standard scientific/technical report. The\n",
|
||||
"reports written like a standard scientific/technical report. The\n",
|
||||
"links at\n",
|
||||
"<https://github.com/CompPhysics/MachineLearning/tree/master/doc/Projects>\n",
|
||||
"contain more information. There you can find examples of previous\n",
|
||||
@@ -63,14 +88,14 @@
|
||||
"been studied in the scientific literature. This makes it easier for\n",
|
||||
"you to compare and analyze your results. Comparing with existing\n",
|
||||
"results from the scientific literature is also an essential element of\n",
|
||||
"the scientific discussion. The University of California at Irvine\n",
|
||||
"the scientific discussion. The University of California at Irvine\n",
|
||||
"with its Machine Learning repository at\n",
|
||||
"<https://archive.ics.uci.edu/ml/index.php> is an excellent site to\n",
|
||||
"look up for examples and\n",
|
||||
"inspiration. [Kaggle.com](https://www.kaggle.com/) is an equally\n",
|
||||
"interesting site. Feel free to explore these sites. When selecting\n",
|
||||
"other data sets, make sure these are sets used for regression problems\n",
|
||||
"(not classification)."
|
||||
"(not classification).\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -90,7 +115,7 @@
|
||||
"We will study how to fit polynomials to specific\n",
|
||||
"one-dimensional functions (feel free to replace the suggested function with more complicated ones).\n",
|
||||
"\n",
|
||||
"We will use Runge's function (see <https://en.wikipedia.org/wiki/Runge%27s_phenomenon> for a discussion). The one-dimensional function we will study is"
|
||||
"We will use Runge's function (see <https://en.wikipedia.org/wiki/Runge%27s_phenomenon> for a discussion). The one-dimensional function we will study is\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -102,7 +127,7 @@
|
||||
"source": [
|
||||
"$$\n",
|
||||
"f(x) = \\frac{1}{1+25x^2}.\n",
|
||||
"$$"
|
||||
"$$\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -114,14 +139,14 @@
|
||||
"source": [
|
||||
"Our first step will be to perform an OLS regression analysis of this\n",
|
||||
"function, trying out a polynomial fit with an $x$ dependence of the\n",
|
||||
"form $[x,x^2,\\dots]$. You can use a uniform distribution to set up the\n",
|
||||
"form $[x,x^2,\\dots]$. You can use a uniform distribution to set up the\n",
|
||||
"arrays of values for $x \\in [-1,1]$, or alternatively use a fixed step size.\n",
|
||||
"Thereafter we will repeat many of the same steps when using the Ridge and Lasso regression methods,\n",
|
||||
"introducing thereby a dependence on the hyperparameter (penalty) $\\lambda$.\n",
|
||||
"introducing thereby a dependence on the hyperparameter (penalty) $\\lambda$.\n",
|
||||
"\n",
|
||||
"We will also include bootstrap as a resampling technique in order to\n",
|
||||
"study the so-called **bias-variance tradeoff**. After that we will\n",
|
||||
"include the so-called cross-validation technique."
|
||||
"study the so-called **bias-variance tradeoff**. After that we will\n",
|
||||
"include the so-called cross-validation technique.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -133,15 +158,15 @@
|
||||
"source": [
|
||||
"### Part a : Ordinary Least Square (OLS) for the Runge function\n",
|
||||
"\n",
|
||||
"We will generate our own dataset for abovementioned function\n",
|
||||
"We will generate our own dataset for abovementioned function\n",
|
||||
"$\\mathrm{Runge}(x)$ function with $x\\in [-1,1]$. You should explore also the addition\n",
|
||||
"of an added stochastic noise to this function using the normal\n",
|
||||
"distribution $N(0,1)$.\n",
|
||||
"\n",
|
||||
"*Write your own code* (using for example the pseudoinverse function **pinv** from **Numpy** ) and perform a standard **ordinary least square regression**\n",
|
||||
"analysis using polynomials in $x$ up to order $15$ or higher. Explore the dependence on the number of data points and the polynomial degree.\n",
|
||||
"_Write your own code_ (using for example the pseudoinverse function **pinv** from **Numpy** ) and perform a standard **ordinary least square regression**\n",
|
||||
"analysis using polynomials in $x$ up to order $15$ or higher. Explore the dependence on the number of data points and the polynomial degree.\n",
|
||||
"\n",
|
||||
"Evaluate the mean Squared error (MSE)"
|
||||
"Evaluate the mean Squared error (MSE)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -154,7 +179,7 @@
|
||||
"$$\n",
|
||||
"MSE(\\boldsymbol{y},\\tilde{\\boldsymbol{y}}) = \\frac{1}{n}\n",
|
||||
"\\sum_{i=0}^{n-1}(y_i-\\tilde{y}_i)^2,\n",
|
||||
"$$"
|
||||
"$$\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -164,9 +189,9 @@
|
||||
"editable": true
|
||||
},
|
||||
"source": [
|
||||
"and the $R^2$ score function. If $\\tilde{\\boldsymbol{y}}_i$ is the predicted\n",
|
||||
"and the $R^2$ score function. If $\\tilde{\\boldsymbol{y}}_i$ is the predicted\n",
|
||||
"value of the $i-th$ sample and $y_i$ is the corresponding true value,\n",
|
||||
"then the score $R^2$ is defined as"
|
||||
"then the score $R^2$ is defined as\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -178,7 +203,7 @@
|
||||
"source": [
|
||||
"$$\n",
|
||||
"R^2(\\boldsymbol{y}, \\tilde{\\boldsymbol{y}}) = 1 - \\frac{\\sum_{i=0}^{n - 1} (y_i - \\tilde{y}_i)^2}{\\sum_{i=0}^{n - 1} (y_i - \\bar{y})^2},\n",
|
||||
"$$"
|
||||
"$$\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -188,7 +213,7 @@
|
||||
"editable": true
|
||||
},
|
||||
"source": [
|
||||
"where we have defined the mean value of $\\boldsymbol{y}$ as"
|
||||
"where we have defined the mean value of $\\boldsymbol{y}$ as\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -200,7 +225,7 @@
|
||||
"source": [
|
||||
"$$\n",
|
||||
"\\bar{y} = \\frac{1}{n} \\sum_{i=0}^{n - 1} y_i.\n",
|
||||
"$$"
|
||||
"$$\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -215,23 +240,23 @@
|
||||
"\n",
|
||||
"Your code has to include a scaling/centering of the data (for example by\n",
|
||||
"subtracting the mean value), and\n",
|
||||
"a split of the data in training and test data. For the scaling you can\n",
|
||||
"a split of the data in training and test data. For the scaling you can\n",
|
||||
"either write your own code or use for example the function for\n",
|
||||
"splitting training data provided by the library **Scikit-Learn** (make\n",
|
||||
"sure you have installed it). This function is called\n",
|
||||
"$train\\_test\\_split$. **You should present a critical discussion of why and how you have scaled or not scaled the data**.\n",
|
||||
"sure you have installed it). This function is called\n",
|
||||
"$train\\_test\\_split$. **You should present a critical discussion of why and how you have scaled or not scaled the data**.\n",
|
||||
"\n",
|
||||
"It is normal in essentially all Machine Learning studies to split the\n",
|
||||
"data in a training set and a test set (eventually also an additional\n",
|
||||
"validation set). There\n",
|
||||
"data in a training set and a test set (eventually also an additional\n",
|
||||
"validation set). There\n",
|
||||
"is no explicit recipe for how much data should be included as training\n",
|
||||
"data and say test data. An accepted rule of thumb is to use\n",
|
||||
"data and say test data. An accepted rule of thumb is to use\n",
|
||||
"approximately $2/3$ to $4/5$ of the data as training data.\n",
|
||||
"\n",
|
||||
"You can easily reuse the solutions to your exercises from week 35.\n",
|
||||
"See also the lecture slides from week 35 and week 36.\n",
|
||||
"\n",
|
||||
"On scaling, we recommend reading the following section from the scikit-learn software description, see <https://scikit-learn.org/stable/auto_examples/preprocessing/plot_all_scaling.html#plot-all-scaling-standard-scaler-section>."
|
||||
"On scaling, we recommend reading the following section from the scikit-learn software description, see <https://scikit-learn.org/stable/auto_examples/preprocessing/plot_all_scaling.html#plot-all-scaling-standard-scaler-section>.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -241,14 +266,14 @@
|
||||
"editable": true
|
||||
},
|
||||
"source": [
|
||||
"### Part b: Adding Ridge regression for the Runge function\n",
|
||||
"### Part b: Adding Ridge regression for the Runge function\n",
|
||||
"\n",
|
||||
"Write your own code for the Ridge method as done in the previous\n",
|
||||
"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.\n",
|
||||
"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.\n",
|
||||
"\n",
|
||||
"Perform the same analysis as you did in the previous exercise but now for different values of $\\lambda$. Compare and\n",
|
||||
"analyze your results with those obtained in part a) with the OLS method. Study the\n",
|
||||
"dependence on $\\lambda$."
|
||||
"analyze your results with those obtained in part a) with the OLS method. Study the\n",
|
||||
"dependence on $\\lambda$.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -267,7 +292,7 @@
|
||||
"from week 36).\n",
|
||||
"\n",
|
||||
"Study and compare your results from parts a) and b) with your gradient\n",
|
||||
"descent approch. Discuss in particular the role of the learning rate."
|
||||
"descent approch. Discuss in particular the role of the learning rate.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -283,7 +308,7 @@
|
||||
"the gradient descent method by including **momentum**, **ADAgrad**,\n",
|
||||
"**RMSprop** and **ADAM** as methods fro iteratively updating your learning\n",
|
||||
"rate. Discuss the results and compare the different methods applied to\n",
|
||||
"the one-dimensional Runge function. The lecture notes from week 37 contain several examples on how to implement these methods."
|
||||
"the one-dimensional Runge function. The lecture notes from week 37 contain several examples on how to implement these methods.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -299,12 +324,12 @@
|
||||
"represents our first encounter with a machine learning method which\n",
|
||||
"cannot be solved through analytical expressions (as in OLS and Ridge regression). Use the gradient\n",
|
||||
"descent methods you developed in parts c) and d) to solve the LASSO\n",
|
||||
"optimization problem. You can compare your results with \n",
|
||||
"optimization problem. You can compare your results with\n",
|
||||
"the functionalities of **Scikit-Learn**.\n",
|
||||
"\n",
|
||||
"Discuss (critically) your results for the Runge function from OLS,\n",
|
||||
"Ridge and LASSO regression using the various gradient descent\n",
|
||||
"approaches."
|
||||
"approaches.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -319,7 +344,7 @@
|
||||
"Our last gradient step is to include stochastic gradient descent using\n",
|
||||
"the same methods to update the learning rates as in parts c-e).\n",
|
||||
"Compare and discuss your results with and without stochastic gradient\n",
|
||||
"and give a critical assessment of the various methods."
|
||||
"and give a critical assessment of the various methods.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -332,14 +357,14 @@
|
||||
"### Part g: Bias-variance trade-off and resampling techniques\n",
|
||||
"\n",
|
||||
"Our aim here is to study the bias-variance trade-off by implementing\n",
|
||||
"the **bootstrap** resampling technique. **We will only use the simpler\n",
|
||||
"the **bootstrap** resampling technique. **We will only use the simpler\n",
|
||||
"ordinary least squares here**.\n",
|
||||
"\n",
|
||||
"With a code which does OLS and includes resampling techniques, \n",
|
||||
"With a code which does OLS and includes resampling techniques,\n",
|
||||
"we will now discuss the bias-variance trade-off in the context of\n",
|
||||
"continuous predictions such as regression. However, many of the\n",
|
||||
"intuitions and ideas discussed here also carry over to classification\n",
|
||||
"tasks and basically all Machine Learning algorithms. \n",
|
||||
"tasks and basically all Machine Learning algorithms.\n",
|
||||
"\n",
|
||||
"Before you perform an analysis of the bias-variance trade-off on your\n",
|
||||
"test data, make first a figure similar to Fig. 2.11 of Hastie,\n",
|
||||
@@ -356,7 +381,7 @@
|
||||
"dataset $\\mathcal{L}$ consisting of the data\n",
|
||||
"$\\mathbf{X}_\\mathcal{L}=\\{(y_j, \\boldsymbol{x}_j), j=0\\ldots n-1\\}$.\n",
|
||||
"\n",
|
||||
"We assume that the true data is generated from a noisy model"
|
||||
"We assume that the true data is generated from a noisy model\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -368,7 +393,7 @@
|
||||
"source": [
|
||||
"$$\n",
|
||||
"\\boldsymbol{y}=f(\\boldsymbol{x}) + \\boldsymbol{\\epsilon}.\n",
|
||||
"$$"
|
||||
"$$\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -387,7 +412,7 @@
|
||||
"that is $\\boldsymbol{\\tilde{y}}=\\boldsymbol{X}\\boldsymbol{\\theta}$.\n",
|
||||
"\n",
|
||||
"The parameters $\\boldsymbol{\\theta}$ are in turn found by optimizing the mean\n",
|
||||
"squared error via the so-called cost function"
|
||||
"squared error via the so-called cost function\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -399,7 +424,7 @@
|
||||
"source": [
|
||||
"$$\n",
|
||||
"C(\\boldsymbol{X},\\boldsymbol{\\theta}) =\\frac{1}{n}\\sum_{i=0}^{n-1}(y_i-\\tilde{y}_i)^2=\\mathbb{E}\\left[(\\boldsymbol{y}-\\boldsymbol{\\tilde{y}})^2\\right].\n",
|
||||
"$$"
|
||||
"$$\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -409,14 +434,14 @@
|
||||
"editable": true
|
||||
},
|
||||
"source": [
|
||||
"Here the expected value $\\mathbb{E}$ is the sample value. \n",
|
||||
"Here the expected value $\\mathbb{E}$ is the sample value.\n",
|
||||
"\n",
|
||||
"Show that you can rewrite this in terms of a term which contains the\n",
|
||||
"variance of the model itself (the so-called variance term), a term\n",
|
||||
"which measures the deviation from the true data and the mean value of\n",
|
||||
"the model (the bias term) and finally the variance of the noise.\n",
|
||||
"\n",
|
||||
"That is, show that"
|
||||
"That is, show that\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -428,7 +453,7 @@
|
||||
"source": [
|
||||
"$$\n",
|
||||
"\\mathbb{E}\\left[(\\boldsymbol{y}-\\boldsymbol{\\tilde{y}})^2\\right]=\\mathrm{Bias}[\\tilde{y}]+\\mathrm{var}[\\tilde{y}]+\\sigma^2,\n",
|
||||
"$$"
|
||||
"$$\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -438,7 +463,7 @@
|
||||
"editable": true
|
||||
},
|
||||
"source": [
|
||||
"with (we approximate $f(\\boldsymbol{x})\\approx \\boldsymbol{y}$)"
|
||||
"with (we approximate $f(\\boldsymbol{x})\\approx \\boldsymbol{y}$)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -450,7 +475,7 @@
|
||||
"source": [
|
||||
"$$\n",
|
||||
"\\mathrm{Bias}[\\tilde{y}]=\\mathbb{E}\\left[\\left(\\boldsymbol{y}-\\mathbb{E}\\left[\\boldsymbol{\\tilde{y}}\\right]\\right)^2\\right],\n",
|
||||
"$$"
|
||||
"$$\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -460,7 +485,7 @@
|
||||
"editable": true
|
||||
},
|
||||
"source": [
|
||||
"and"
|
||||
"and\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -472,7 +497,7 @@
|
||||
"source": [
|
||||
"$$\n",
|
||||
"\\mathrm{var}[\\tilde{y}]=\\mathbb{E}\\left[\\left(\\tilde{\\boldsymbol{y}}-\\mathbb{E}\\left[\\boldsymbol{\\tilde{y}}\\right]\\right)^2\\right]=\\frac{1}{n}\\sum_i(\\tilde{y}_i-\\mathbb{E}\\left[\\boldsymbol{\\tilde{y}}\\right])^2.\n",
|
||||
"$$"
|
||||
"$$\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -482,11 +507,11 @@
|
||||
"editable": true
|
||||
},
|
||||
"source": [
|
||||
"**Important note**: 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}$. \n",
|
||||
"**Important note**: 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}$.\n",
|
||||
"\n",
|
||||
"The answer to this exercise should be included in the theory part of\n",
|
||||
"the report. This exercise is also part of the weekly exercises of\n",
|
||||
"week 38. Explain what the terms mean and discuss their\n",
|
||||
"the report. This exercise is also part of the weekly exercises of\n",
|
||||
"week 38. Explain what the terms mean and discuss their\n",
|
||||
"interpretations.\n",
|
||||
"\n",
|
||||
"Perform then a bias-variance analysis of the Runge function by\n",
|
||||
@@ -495,7 +520,7 @@
|
||||
"Discuss the bias and variance trade-off as function\n",
|
||||
"of your model complexity (the degree of the polynomial) and the number\n",
|
||||
"of data points, and possibly also your training and test data using the **bootstrap** resampling method.\n",
|
||||
"You can follow the code example in the jupyter-book at <https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/chapter3.html#the-bias-variance-tradeoff>."
|
||||
"You can follow the code example in the jupyter-book at <https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/chapter3.html#the-bias-variance-tradeoff>.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -505,20 +530,20 @@
|
||||
"editable": true
|
||||
},
|
||||
"source": [
|
||||
"### Part h): Cross-validation as resampling techniques, adding more complexity\n",
|
||||
"### Part h): Cross-validation as resampling techniques, adding more complexity\n",
|
||||
"\n",
|
||||
"The aim here is to implement another widely popular\n",
|
||||
"resampling technique, the so-called cross-validation method. \n",
|
||||
"resampling technique, the so-called cross-validation method.\n",
|
||||
"\n",
|
||||
"Implement the $k$-fold cross-validation algorithm (feel free to use\n",
|
||||
"the functionality of **Scikit-Learn** or write your own code) and\n",
|
||||
"evaluate again the MSE function resulting from the test folds.\n",
|
||||
"\n",
|
||||
"Compare the MSE you get from your cross-validation code with the one\n",
|
||||
"you got from your **bootstrap** code from the previous exercise. Comment and interpret your results. \n",
|
||||
"you got from your **bootstrap** code from the previous exercise. Comment and interpret your results.\n",
|
||||
"\n",
|
||||
"In addition to using the ordinary least squares method, you should\n",
|
||||
"include both Ridge and Lasso regression in the final analysis."
|
||||
"include both Ridge and Lasso regression in the final analysis.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -532,7 +557,7 @@
|
||||
"\n",
|
||||
"1. For a discussion and derivation of the variances and mean squared errors using linear regression, see the [Lecture notes on ridge regression by Wessel N. van Wieringen](https://arxiv.org/abs/1509.09169)\n",
|
||||
"\n",
|
||||
"2. The textbook of [Trevor Hastie, Robert Tibshirani, Jerome H. Friedman, The Elements of Statistical Learning, Springer](https://www.springer.com/gp/book/9780387848570), chapters 3 and 7 are the most relevant ones for the analysis of parts g) and h)."
|
||||
"2. The textbook of [Trevor Hastie, Robert Tibshirani, Jerome H. Friedman, The Elements of Statistical Learning, Springer](https://www.springer.com/gp/book/9780387848570), chapters 3 and 7 are the most relevant ones for the analysis of parts g) and h).\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -544,25 +569,25 @@
|
||||
"source": [
|
||||
"## Introduction to numerical projects\n",
|
||||
"\n",
|
||||
"Here follows a brief recipe and recommendation on how to answer the various questions when preparing your answers. \n",
|
||||
"Here follows a brief recipe and recommendation on how to answer the various questions when preparing your answers.\n",
|
||||
"\n",
|
||||
" * Give a short description of the nature of the problem and the eventual numerical methods you have used.\n",
|
||||
"- Give a short description of the nature of the problem and the eventual numerical methods you have used.\n",
|
||||
"\n",
|
||||
" * Describe the algorithm you have used and/or developed. Here you may find it convenient to use pseudocoding. In many cases you can describe the algorithm in the program itself.\n",
|
||||
"- Describe the algorithm you have used and/or developed. Here you may find it convenient to use pseudocoding. In many cases you can describe the algorithm in the program itself.\n",
|
||||
"\n",
|
||||
" * Include the source code of your program. Comment your program properly. You should have the code at your GitHub/GitLab link. You can also place the code in an appendix of your report.\n",
|
||||
"- Include the source code of your program. Comment your program properly. You should have the code at your GitHub/GitLab link. You can also place the code in an appendix of your report.\n",
|
||||
"\n",
|
||||
" * If possible, try to find analytic solutions, or known limits in order to test your program when developing the code.\n",
|
||||
"- If possible, try to find analytic solutions, or known limits in order to test your program when developing the code.\n",
|
||||
"\n",
|
||||
" * Include your results either in figure form or in a table. Remember to label your results. All tables and figures should have relevant captions and labels on the axes.\n",
|
||||
"- Include your results either in figure form or in a table. Remember to label your results. All tables and figures should have relevant captions and labels on the axes.\n",
|
||||
"\n",
|
||||
" * Try to evaluate the reliabilty and numerical stability/precision of your results. If possible, include a qualitative and/or quantitative discussion of the numerical stability, eventual loss of precision etc.\n",
|
||||
"- Try to evaluate the reliabilty and numerical stability/precision of your results. If possible, include a qualitative and/or quantitative discussion of the numerical stability, eventual loss of precision etc.\n",
|
||||
"\n",
|
||||
" * Try to give an interpretation of you results in your answers to the problems.\n",
|
||||
"- Try to give an interpretation of you results in your answers to the problems.\n",
|
||||
"\n",
|
||||
" * Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts you've made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it.\n",
|
||||
"- Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts you've made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it.\n",
|
||||
"\n",
|
||||
" * Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning."
|
||||
"- Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -574,17 +599,17 @@
|
||||
"source": [
|
||||
"## Format for electronic delivery of report and programs\n",
|
||||
"\n",
|
||||
"The preferred format for the report is a PDF file. You can also use DOC or postscript formats or as an ipython notebook file. As programming language we prefer that you choose between C/C++, Fortran2008, Julia or Python. The following prescription should be followed when preparing the report:\n",
|
||||
"The preferred format for the report is a PDF file. You can also use DOC or postscript formats or as an ipython notebook file. As programming language we prefer that you choose between C/C++, Fortran2008, Julia or Python. The following prescription should be followed when preparing the report:\n",
|
||||
"\n",
|
||||
" * Use Canvas to hand in your projects, log in at <https://www.uio.no/english/services/it/education/canvas/> with your normal UiO username and password.\n",
|
||||
"- Use Canvas to hand in your projects, log in at <https://www.uio.no/english/services/it/education/canvas/> with your normal UiO username and password.\n",
|
||||
"\n",
|
||||
" * Upload **only** the report file or the link to your GitHub/GitLab or similar typo of repos! For the source code file(s) you have developed please provide us with your link to your GitHub/GitLab or similar domain. The report file should include all of your discussions and a list of the codes you have developed. Do not include library files which are available at the course homepage, unless you have made specific changes to them.\n",
|
||||
"- Upload **only** the report file or the link to your GitHub/GitLab or similar typo of repos! For the source code file(s) you have developed please provide us with your link to your GitHub/GitLab or similar domain. The report file should include all of your discussions and a list of the codes you have developed. Do not include library files which are available at the course homepage, unless you have made specific changes to them.\n",
|
||||
"\n",
|
||||
" * In your GitHub/GitLab or similar repository, please include a folder which contains selected results. These can be in the form of output from your code for a selected set of runs and input parameters.\n",
|
||||
"- In your GitHub/GitLab or similar repository, please include a folder which contains selected results. These can be in the form of output from your code for a selected set of runs and input parameters.\n",
|
||||
"\n",
|
||||
"Finally, \n",
|
||||
"we encourage you to collaborate. Optimal working groups consist of \n",
|
||||
"2-3 students. You can then hand in a common report."
|
||||
"Finally,\n",
|
||||
"we encourage you to collaborate. Optimal working groups consist of\n",
|
||||
"2-3 students. You can then hand in a common report.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -596,42 +621,46 @@
|
||||
"source": [
|
||||
"## Software and needed installations\n",
|
||||
"\n",
|
||||
"If you have Python installed (we recommend Python3) and you feel pretty familiar with installing different packages, \n",
|
||||
"If you have Python installed (we recommend Python3) and you feel pretty familiar with installing different packages,\n",
|
||||
"we recommend that you install the following Python packages via **pip** as\n",
|
||||
"\n",
|
||||
"1. pip install numpy scipy matplotlib ipython scikit-learn tensorflow sympy pandas pillow\n",
|
||||
"\n",
|
||||
"For Python3, replace **pip** with **pip3**.\n",
|
||||
"\n",
|
||||
"See below for a discussion of **tensorflow** and **scikit-learn**. \n",
|
||||
"See below for a discussion of **tensorflow** and **scikit-learn**.\n",
|
||||
"\n",
|
||||
"For OSX users we recommend also, after having installed Xcode, to install **brew**. Brew allows \n",
|
||||
"For OSX users we recommend also, after having installed Xcode, to install **brew**. Brew allows\n",
|
||||
"for a seamless installation of additional software via for example\n",
|
||||
"\n",
|
||||
"1. brew install python3\n",
|
||||
"\n",
|
||||
"For Linux users, with its variety of distributions like for example the widely popular Ubuntu distribution\n",
|
||||
"you can use **pip** as well and simply install Python as \n",
|
||||
"1. sudo apt-get install python3 (or python for python2.7)\n",
|
||||
"you can use **pip** as well and simply install Python as\n",
|
||||
"\n",
|
||||
"etc etc. \n",
|
||||
"1. sudo apt-get install python3 (or python for python2.7)\n",
|
||||
"\n",
|
||||
"etc etc.\n",
|
||||
"\n",
|
||||
"If you don't want to install various Python packages with their dependencies separately, we recommend two widely used distrubutions which set up all relevant dependencies for Python, namely\n",
|
||||
"\n",
|
||||
"If you don't want to install various Python packages with their dependencies separately, we recommend two widely used distrubutions which set up all relevant dependencies for Python, namely\n",
|
||||
"1. [Anaconda](https://docs.anaconda.com/) Anaconda is an open source distribution of the Python and R programming languages for large-scale data processing, predictive analytics, and scientific computing, that aims to simplify package management and deployment. Package versions are managed by the package management system **conda**\n",
|
||||
"\n",
|
||||
"2. [Enthought canopy](https://www.enthought.com/product/canopy/) is a Python distribution for scientific and analytic computing distribution and analysis environment, available for free and under a commercial license.\n",
|
||||
"2. [Enthought canopy](https://www.enthought.com/product/canopy/) is a Python distribution for scientific and analytic computing distribution and analysis environment, available for free and under a commercial license.\n",
|
||||
"\n",
|
||||
"Popular software packages written in Python for ML are\n",
|
||||
"\n",
|
||||
"* [Scikit-learn](http://scikit-learn.org/stable/), \n",
|
||||
"- [Scikit-learn](http://scikit-learn.org/stable/),\n",
|
||||
"\n",
|
||||
"* [Tensorflow](https://www.tensorflow.org/),\n",
|
||||
"- [Tensorflow](https://www.tensorflow.org/),\n",
|
||||
"\n",
|
||||
"* [PyTorch](http://pytorch.org/) and \n",
|
||||
"- [PyTorch](http://pytorch.org/) and\n",
|
||||
"\n",
|
||||
"* [Keras](https://keras.io/).\n",
|
||||
"- [Keras](https://keras.io/).\n",
|
||||
"\n",
|
||||
"These are all freely available at their respective GitHub sites. They \n",
|
||||
"These are all freely available at their respective GitHub sites. They\n",
|
||||
"encompass communities of developers in the thousands or more. And the number\n",
|
||||
"of code developers and contributors keeps increasing."
|
||||
"of code developers and contributors keeps increasing.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -38,16 +38,15 @@
|
||||
"In canvas, deliver as a group and include:\n",
|
||||
"\n",
|
||||
"- A PDF of your report which follows the guidelines covered below and in the week 39 exercises. Additional requirements include:\n",
|
||||
" - It should be around 5000 words, use the word counter in Overleaf for this.\n",
|
||||
" - It should be around 10 pages long, not including references or appendices.\n",
|
||||
" - It should include around 10-15 figures.\n",
|
||||
" - It should be around 5000 words, use the word counter in Overleaf for this. This often corresponds to 10-12 pages. References and appendices are excluded from the word count\n",
|
||||
" - It should include around 10-15 figures. You can include more figures in appendices and/or as supplemental material in your repository.\n",
|
||||
"- A comment linking to your github repository (or folder in one of your github repositories) for this project. The repository must include\n",
|
||||
" - A PDF of the report\n",
|
||||
" - A PDF file of the report\n",
|
||||
" - A folder named Code, where you put python files for your functions and notebooks for reproducing your results. Remember to use a seed for generating random data and for train-test splits when generating final results.\n",
|
||||
" - A README file with\n",
|
||||
" - the name of the group members\n",
|
||||
" - a short description of the project\n",
|
||||
" - a description of how to install the required packages to run your code from a requirements.txt file\n",
|
||||
" - a description of how to install the required packages to run your code from a requirements.txt file or similar (such as a plain text description)\n",
|
||||
" - names and descriptions of the various notebooks in the Code folder and the results they produce\n"
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user