CPSC 340 - Labs

These scripts are here to supplement what’s on Connect. Mostly they’re just minor modifications of what’s there already… if in doubt, use what’s on Connect…


Lab 7

I’ve included a bonus section at the end that shows how we can manually make bootstrap samples and use them to train an ensemble of trees (not a random forest because we don’t randomly pick features to learn from). You’ll notice this improves the tree MSE from roughly 152 to 142 (and in doing so matches the performance of the SVM).

Lab 7


Lab 6

Lab 6


Lab 5

Lab 5


Lab 4

This file may be useful if you’re interested in learning how to use RMarkdown. It’s optional, but I find it useful

Lab 4 - Rmd file


Lab 3

Lab 3 Script

There was some confusion on the forum following Lab 3 about the effect of feature normalisation on accuracy (where accuracy is defined as MSE on the test error). If you’re interested, here’s my response to why we got the solution we did.

MSE Discussion - script


Lab 2

Lab 2 Script


Lab 1

Lab 1 Script


Lab 0

Lab 0 Script