Skip to content

Commit 4d3622a

Browse files
committed
updating fourGaussians data set, updating tests
1 parent 9593982 commit 4d3622a

File tree

6 files changed

+199
-277
lines changed

6 files changed

+199
-277
lines changed

data/fourGaussians.rda

0 Bytes
Binary file not shown.

inst/cec_tests/cec1.dp

Lines changed: 0 additions & 269 deletions
This file was deleted.

inst/cec_tests/clustering.test.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
testname <- "Clustering"
22
setup <- function()
3-
{
4-
M <- as.matrix(read.table(system.file("cec_tests", "mouse1.data", package="CEC")))
5-
C <- as.matrix(read.table(system.file("cec_tests", "centers1.data", package="CEC")))
6-
expected <- dget(system.file("cec_tests", "cec1.dp", package="CEC"))
3+
{
4+
data("fourGaussians", package = "CEC")
5+
centers <- as.matrix(read.table(system.file("cec_tests", "four.gaussians.centers.data", package="CEC")))
6+
expected <- dget(system.file("cec_tests", "four.gaussians.result.dp", package="CEC"))
77
}
88

9-
test.clustering.mouse1 <- function()
9+
test.clustering.four.gaussians <- function()
1010
{
11-
CEC <- cec(M, C)
11+
CEC <- cec(fourGaussians, centers)
1212
CEC:::checkNumericVectorEquals(expected$cluster, CEC$cluster, msg="Clustering vector")
1313
CEC:::checkNumericVectorEquals(expected$cost, CEC$cost, msg="Energy")
1414
CEC:::checkNumericMatrixEquals(expected$centers, CEC$centers, msg="Centers")
15-
CEC:::checkNumericMatrixEquals(M, CEC$data, msg="Data")
15+
CEC:::checkNumericMatrixEquals(fourGaussians, CEC$data, msg="Data")
1616
CEC:::checkNumericVectorEquals(expected$probability, CEC$probability, msg="Probability")
1717
CEC:::checkNumericVectorEquals(expected$nclusters, CEC$nclusters, msg="Number of clusters")
1818
CEC:::checkNumericVectorEquals(expected$iterations, CEC$iterations, msg="Iterations")
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
1.01907725638331 2.35490540074148
2+
-3.02767008221039 -2.86906071414027
3+
-0.0242720163788669 -0.648301422440495
4+
2.55004588700554 0.0810649917238939

0 commit comments

Comments
 (0)