Publications by Brandon Lwowski
HW6 STA 6543
Assignment 6 Applied Problem 6 Part a: After performing the 10-Fold cross-validation on the Wage dataset, a polynomial of degree 10 has the lowest Test MSE. Although degree 10 resulted in the best model, it adds complexity with little benefit. Looking at the plot below, degree 4 and degree 10 have similar Test MSE’s. This is also validated in...
1492 sym R (5860 sym/17 pcs) 5 img
Brandon Lwowski HW 4 STA 6543
Conceptual Problem 3 a The \(k-fold\) cross validation is implemented by taking the \(n\) observations and randomly splitting it into \(k\) non-overlapping groups of length of (approximately) \(n/k\). These groups acts as a validation set, and the remainder of length \((n-n/k)\) acts as a training set. The test error is then estimated by averagi...
2736 sym R (6104 sym/34 pcs)
Document
Problem 2 The KNN classifier is typically used to classification problems, those with a qualitative/categorical target variable. This is done by collecting the neighboring points (by some distance function) and estimating the class by using a voting algorithm. The majority class of the neighbors gets assigned as the class of the observation. The ...
2315 sym R (6335 sym/33 pcs) 3 img
HW3
Problem 10 Part a library(ISLR) library(corrplot) ## corrplot 0.90 loaded library(MASS) library(class) data("Weekly", package = "ISLR") summary(Weekly) ## Year Lag1 Lag2 Lag3 ## Min. :1990 Min. :-18.1950 Min. :-18.1950 Min. :-18.1950 ## 1st Qu.:1995 1st Qu.: -1.1540 1st ...
1543 sym R (18908 sym/113 pcs) 5 img
HW 5 STA 6543
Conceptual Problem 2 a Lasso i. Incorrect ii. Incorrect iii. Correct. Lasso is less flexible (for \(\lambda\) > \(0\)), giving increased prediction accuracy provided that the he increase in bias is outweighed by the decrease in variance. iv. Incorrect b Ridge i. Incorrect ii. Incorrect iii. Correct. It is for the same reasons as part \((a)\) sin...
1620 sym R (10805 sym/30 pcs)
HW7 STA 6543
Conceptual Problem 3: In a setting with two classes… Applied Problem 8: (a) library(ISLR) library(tree) library(randomForest) ## Warning: package 'randomForest' was built under R version 4.1.2 ## randomForest 4.7-1 ## Type rfNews() to see new features/changes/bug fixes. set.seed(123) train = sample(1:nrow(Carseats), nrow(Carseats) / 2) Car...
320 sym R (6048 sym/39 pcs) 6 img
STA 6543 HW8
Conceptual Problem 5 (a) \(\hat{g}_2\) has more flexibility so theoretically it will have the smaller train RSS. (b) This question cannot be directly answered, but in most cases \(\hat{g}_1\) should obtain better test RSS in cases since it it not as flexible. \(\hat{g}_2\) can be overtrained on the training data and not be a good representation ...
632 sym R (8716 sym/16 pcs) 8 img