Skip to content

Commit

Permalink
added unittests for dca
Browse files Browse the repository at this point in the history
  • Loading branch information
terrytangyuan committed Aug 27, 2015
1 parent 648a484 commit 3db00ea
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/testthat/test_algorithms.R
Expand Up @@ -3,6 +3,14 @@ library(lfda)
library(MASS)

test_that('dca works', {
k = 100 # sample size of each class
n = 3 # specify how many class
N = k * n # total sample number
x1 = mvrnorm(k, mu = c(-10, 6), matrix(c(10, 4, 4, 10), ncol = 2))
x2 = mvrnorm(k, mu = c(0, 0), matrix(c(10, 4, 4, 10), ncol = 2))
x3 = mvrnorm(k, mu = c(10, -6), matrix(c(10, 4, 4, 10), ncol = 2))
data = as.data.frame(rbind(x1, x2, x3))

chunk1 = sample(1:100, 5)
chunk2 = sample(setdiff(1:100, chunk1), 5)
chunk3 = sample(101:200, 5)
Expand Down

0 comments on commit 3db00ea

Please sign in to comment.