MTH6101 Introduction to Machine Learning Laboratory week two
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
MTH6101 Introduction to Machine Learning
Laboratory week two
The intention of this laboratory is to do a review of R, its functions and some packages. The tasks involved are matrix computations.
1. Open the package R. This can be done in a variety of ways. You could have downloaded it and installed it from https://cran .r-project .org/ A popu- lar version with interactive menus is RStudio, that can be downloaded from https://rstudio.com/products/rstudio/download/ You can run R online, with https://rdrr.io/snippets/ that allows running with libraries. You can access RStudio from Appsanywhere using the url appsanywhere .qmul .ac .uk.
2. Open a new R script file so that you will write your commands there. Use “File>New File>R Script” in RStudio and “File>New script” if you use the standard version of R. Remember to name this file and to save it in your own folder so that you do not lose your work.
3. Do the activities of Exercise 1 for the matrix seen in lectures, which is the matrix labelled “6” . To use the library pracma remember to install it with the command install .packages("pracma").
4. Repeat the activities for same exercise using the matrix labelled “7” .
5. Do the activities of Exercise 3, using the matrix labelled “2” .
6. In RStudio, open a new R markdown file with “File>New File>R Markdown” and select “pdf” output. Remember to erase everything but the header of this new file. Commands in R must be inside the brackets ‘‘‘{r} and ‘‘‘. To view the output you must compile the file using the “knit” button above the document, or the sequence Ctrl+Shift+K.
To help your markdown tasks, have a look at the useful reference card https: //cran.r-project.org/web//packages/knitr/vignettes/knitr-refcard.pdf
7. Using the code you have already run, experiment with the R markdown ca- pability. Specifically, experiment by
(a) hiding code from view while still executing it and showing the output,
and
(b) hiding both code and standard R output to then create output as part of
the text in the markdown document.
2023-05-05