Machine-Learning

2026-07-12

An Introduction to Statistical Learning: with Applications in R

Lab 2

The Chapter 2 lab is a tour of the language itself – vectors, matrices, indexing, plotting, and loading a data set. What follows is that tour, split into the sections the book uses.

Basic Commands

Vectors are built with c() (concatenate), and both <- and = assign. Arithmetic is element-wise, so operands must share a length – reassigning x to length 3 lets it line up with y:

Read more >

Mathematics for Machine Learning

credit for these solutions goes to: https://github.com/ilmoi/MML-Book

Read more >