Last active
February 25, 2021 00:27
-
-
Save MichaelChirico/1aeec416cf09d21e191fd32310ed5271 to your computer and use it in GitHub Desktop.
Get an R^2 of 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(data.table) | |
DT = fread("~/Downloads/spotifyclass.csv") | |
# add new columns. they're great predictors! | |
DT[ , paste0("V", 1:nrow(DT)) := replicate(.N, rnorm(.N), simplify = FALSE)] | |
summary(lm(DT$target ~ ., data = DT[ , .SD, .SDcols = patterns("^V")]))$r.squared |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment