Publications by Nessie Tran
NessieTran_rem882_HW2
library(ISLR) library(MASS) Exercise 2 Differences between KNN classifier and KNN regression methods. KNN regression tries to predict the value of the output variable y by using a local average point around the output variable. KNN classification tries to predict the class of the output variable y by computing the local probability. Exercise...
4071 sym R (11856 sym/40 pcs) 5 img
NessieTran_rem882_HW3
library(ISLR) library(caret) ## Loading required package: lattice ## Loading required package: ggplot2 library(MASS) library(class) Exercise 10 weekly = Weekly (a) Produce some numerical and graphical summaries of the Weekly data. Do there appear to be any patterns? summary(weekly) ## Year Lag1 Lag2 ...
5873 sym R (40846 sym/79 pcs) 5 img
NessieTran_rem882_HW4
library(ISLR) library(boot) library(MASS) Exercise 3 (a) Explain how k-fold cross-validation is implemented. With k-fold Cross Validation, we divide the data set into k different parts (for example k=5). Then we remove the first part, fit the remaining k-1 (k=5-1=4) parts, and see how good the predictions are performed on the first removed pa...
4603 sym R (6571 sym/42 pcs)
NessieTran_rem882_HW5
Exercise 2 The lasso, relative to least squares, is: Less flexible and hence will give improved prediction accuracy when its increase in bias is less than its decrease in variance. Repeat (a) for ridge regression relative to least squares. The ridge regression relative to least squares is: Less flexible and hence will give improved prediction...
3562 sym R (14884 sym/69 pcs) 5 img
NessieTran_rem882_HW8
library(tidyverse) ## -- Attaching packages --------------------------------------- tidyverse 1.3.0 -- ## v ggplot2 3.3.2 v purrr 0.3.4 ## v tibble 3.0.3 v dplyr 1.0.2 ## v tidyr 1.1.2 v stringr 1.4.0 ## v readr 1.3.1 v forcats 0.5.0 ## -- Conflicts ------------------------------------------ tidyverse_conflicts() -- #...
5404 sym R (27129 sym/79 pcs) 21 img
NessieTran_rem882_HW6
library(ISLR) library(boot) library(leaps) library(gam) ## Loading required package: splines ## Loading required package: foreach ## Loaded gam 1.20 Exercise 6 (a) Perform polynomial regression to predict wage using age. Use cross-validation to select the optimal degree d for the polynomial. What degree was chosen, and how does this compare ...
1701 sym R (6048 sym/27 pcs) 6 img
NessieTran_rem882_HW7
library(ISLR) ## Warning: package 'ISLR' was built under R version 4.0.3 library(tree) ## Warning: package 'tree' was built under R version 4.0.4 library(MASS) library(randomForest) ## Warning: package 'randomForest' was built under R version 4.0.5 ## randomForest 4.6-14 ## Type rfNews() to see new features/changes/bug fixes. library(caret) ## W...
4227 sym R (8442 sym/51 pcs) 7 img