mala::home Davide “+mala” Eynard’s website

27Dec/170

Statistical learning with R: 2018 edition

Here are the homeworks for the Machine Learning course, 2018 edition. If you have not played with R yet, the notes I have attached to the introductory Lab might be of help.

If you attended the class, you probably know what to do with the next posts. After you have ran each demo, answer the questions provided in the demo itself. Add whatever is necessary (screenshots, code, text, links) to motivate your answers and convince me you actually ran the demos and understood their contents. Finally send me everything in a pdf file.

As some of the scripts look for data in the current directory, first of all change the working directory to the one of the source files. To run each demo, just open the R file you will find in each post with the source command in R, for example:


source("./demofilename.R", print.eval = TRUE)

You can find the package containing all of the source and data files you need for your homework here. Remember that while you will not be asked to add much new code to the demos, you should at least be able to understand what the existing code does and modify some parameters to produce different results.

3Feb/170

Statistical learning with R part 4 (2017): Classification

[This post is part of the Statistical learning with R - 2017 edition series. You might want to check out the previous editions too: 2016, 2015]

So, if you are here you probably have already unpacked the zip file. If not, please check this page before starting.

Try to run classification.R: supposing your current working directory is the one where you unpacked the R files, type

source("classification.R",print.eval=TRUE)

The print.eval parameter is needed to show you the output of some commands such as summary in the context of the source command.

Run the demo and try answering the questions you find there. In some cases you should be able to do that immediately after looking at the results, in others you will first need to add few lines of code to actually get any result. If you find yourself stuck anywhere, all the material you should need is either in the script itself or in the lab notes.

3Feb/170

Statistical learning with R part 3 (2017): Clustering

[This post is part of the Statistical learning with R - 2017 edition series. You might want to check out the previous editions too: 2016, 2015]

So, if you are here you probably have already unpacked the zip file. If not, please check this page before starting.

Try to run clustering.R: supposing your current working directory is the one where you unpacked the R files, type

source("clustering.R",print.eval=TRUE)

The print.eval parameter is needed to show you the output of some commands such as summary in the context of the source command.

Run the demo and try answering the questions you find there. In some cases you should be able to do that immediately after looking at the results, in others you will first need to add few lines of code to actually get any result. If you find yourself stuck anywhere, all the material you should need is either in the script itself or in the lab notes.

1Feb/170

Statistical learning with R part 2 (2017): Correlation vs Causation

[This post is part of the Statistical learning with R - 2017 edition series. You might want to check out the previous editions too: 2016, 2015]

So, if you are here you probably have already unpacked the zip file. If not, please check this page before starting.

Try to run corrcaus.R: supposing your current working directory is the one where you unpacked the R files, type

source("corrcaus.R",print.eval=TRUE)

The print.eval parameter is needed to show you the output of some commands such as summary in the context of the source command.

Run the demo and try answering the questions you find there. In some cases you should be able to do that immediately after looking at the results, in others you will first need to add few lines of code to actually get any result. If you find yourself stuck anywhere, all the material you should need is either in the script itself or in the lab notes.

19Jan/170

Statistical learning with R part 1 (2017): Overfitting

[This post is part of the Statistical learning with R - 2017 edition series. You might want to check out the previous editions too: 2016, 2015]

So, if you are here you probably have already unpacked the zip file. If not, please check this page before starting.

Try to run overfitting.R: supposing your current working directory is the one where you unpacked the R files, type

source("overfitting.R",print.eval=TRUE)

The print.eval parameter is needed to show you the output of some commands such as summary in the context of the source command.

Run the demo and try answering the questions you find there. In some cases you should be able to do that immediately after looking at the results, in others you will first need to add few lines of code to actually get any result. If you find yourself stuck anywhere, all the material you should need is either in the script itself or in the lab notes.

19Jan/170

Statistical learning with R: 2017 edition

New year, new class (with a brand new name!), and a whole bunch of new R demos. If you have not played with R yet, the notes I have attached to the introductory Lab might be of help.

If you attended the class, you probably know what to do with the next posts. After you have ran each demo, answer the related questions you might find both in the blog post and in the demo itself. Add whatever is necessary (screenshots, code, text, links) to motivate your answers and convince me you actually ran the demos and understood their contents. Finally send me everything in a pdf file.

To run each demo, just open the R file you will find in each post with the source command in R, for example:


source("/whatever/your/path/is/demofilename.R",print.eval = TRUE)

For your convenience, here is a package containing all of the source and data files you need for your homework (the package will be updated every time a new demo is added). Remember that while you will not be asked to add much new code to the demos, you should at least be able to understand what the existing code does and modify some parameters to produce different results. Now feel free to play with the following demos:

20Jan/160

Statistical learning with R part 4 (2016): Color quantization with K-means

[This post is part of the Statistical learning with R - 2016 edition series. You might want to check out the 2015 edition too]

So, if you are here you probably have already unpacked the zip file. If not, please check this page before starting.

Try to run ClusteringDemo.R: supposing your current working directory is the one where you unpacked the R files, type

source("ClusteringDemo.R")

Run the demo and try answering the questions you find there. In some cases you should be able to do that immediately after looking at the results, in others you will first need to add few lines of code to actually get any result. If you find yourself stuck anywhere, all the material you should need is either in the script itself or in the lab notes.

19Jan/160

Statistical learning with R part 3 (2016): Classification with LDA

[This post is part of the Statistical learning with R - 2016 edition series. You might want to check out the 2015 edition too]

So, if you are here you probably have already unpacked the zip file. If not, please check this page before starting.

Try to run ClassificationDemo.R: supposing your current working directory is the one where you unpacked the R files, type

source("ClassificationDemo.R")

Run the demo and try answering the questions you find there. In some cases you should be able to do that immediately after looking at the results, in others you will first need to add few lines of code to actually get any result. If you find yourself stuck anywhere, all the material you should need is either in the script itself or in the lab notes.

17Jan/160

Statistical learning with R part 2 (2016): The curse of dimensionality

[This post is part of the Statistical learning with R - 2016 edition series. You might want to check out the 2015 edition too]

So, if you are here you probably have already unpacked the zip file. If not, please check this page before starting.

Try to run CurseDimDemo.r: supposing your current working directory is the one where you unpacked the R files, type

source("CurseDimDemo.r",print.eval=TRUE)

The print.eval parameter is needed to show you the output of some commands such as summary in the context of the source command.

Run the demo and try answering the questions you find there. In some cases you should be able to do that immediately after looking at the results, in others you will first need to add few lines of code to actually get any result. If you find yourself stuck anywhere, all the material you should need is either in the script itself or in the lab notes.

11Jan/162

Statistical learning with R part 1 (2016): Linear regression

[This post is part of the Statistical learning with R - 2016 edition series. You might want to check out the 2015 edition too]

So, if you are here you probably have already unpacked the zip file. If not, please check this page before starting.

Try to run LinearRegressionDemo.R: supposing your current working directory is the one where you unpacked the R files, type

source("LinearRegressionDemo.R",print.eval=TRUE)

The print.eval parameter is needed to show you the output of some commands such as summary in the context of the source command.

Run the demo and try answering the questions you find there. In some cases you should be able to do that immediately after looking at the results, in others you will first need to add few lines of code to actually get any result. If you find yourself stuck anywhere, all the material you should need is either in the script itself or in the lab notes.