STOR 390
set.seed()
sample(1:100000, 5)
## [1] 48428 99125 83554 43894 63659
sample(1:100000, 5)
## [1] 47913 71315 85607 3417 99655
set.seed(3443)
sample(1:100000, 5)
## [1] 2218 97756 27628 79129 70252
set.seed(3443)
sample(1:100000, 5)
## [1] 2218 97756 27628 79129 70252
knn_functions.R
synthetic_distributions.R
get from github: https://github.com/idc9/stor390/tree/master/notes/cross_validation
# package to sample from the multivariate gaussian distribution
library(mvtnorm)
library(flexclust)
library(class)
library(tidyverse)
library(stringr)
# some helper functions I wrote for this script
# you can find this file in the same folder as the .Rmd document
source('knn_functions.R')
source('synthetic_distributions.R')
# the mixture means should be the same for both training and test sets
mean_seed <- 238
# draw train and test data
data <- gmm_distribution2d(n_neg=200, n_pos=201, mean_seed=mean_seed, data_seed=1232)
test_data <- gmm_distribution2d(n_neg=1000, n_pos=1000, mean_seed=mean_seed, data_seed=52345)