Skip to content

Instantly share code, notes, and snippets.

Krishna Rao kkraoj

Block or report user

Report or block kkraoj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cv_right.rmd
```{r first separate data into folds before choosing features}
# train the model on training set
# Leave out fold
accuracy.rates <- c()
for (itr in seq_len(folds)){
# Note: since input features are already random, no need to shuffle the data
# before creating folds. But ideally, examples need to be shuffled before
# creating folds to get rid of recording/data collecting bias
@kkraoj
kkraoj / cv_wrong.rmd
Last active Jul 11, 2019
Wrong and right way to do CV
View cv_wrong.rmd
```{r setup, include=FALSE}
rm(list=ls())
knitr::opts_chunk$set(echo = TRUE)
library(caret)
library(ggplot2)
```
# Cross validation Example: The wrong way and the right way
You can’t perform that action at this time.