Commit 2d08fb60 authored by Matthias Carnein's avatar Matthias Carnein

Fixed data structure during evaluate

parent 467d20b5
......@@ -96,8 +96,6 @@ evaluate <- function (dsc, dsd, measure, n = 100,
type <- stream:::get_type(dsc, type)
points <- get_points(dsd, n, cluster = TRUE)
## select text column
points = points[,dsc$RObj$textCol, drop = FALSE]
actual <- attr(points, "cluster")
if(missing(measure) || is.null(measure)) {
......@@ -127,6 +125,9 @@ evaluate <- function (dsc, dsd, measure, n = 100,
## assign points
predict <- get_assignment(dsc, points, type=assign, method=assignmentMethod, ...)
## select text column
points = points[,dsc$RObj$textCol, drop = FALSE]
## translate micro to macro cluster ids if necessary
if(type=="macro" && assign=="micro") predict <- microToMacro(dsc, predict)
else if (type!=assign) stop("type and assign are not compatible!")
......
......@@ -55,5 +55,5 @@ get_assignment(algorithm, data)
The algorithm can also be evaluated using prequential (interleaved test-then-train) evaluation:
```R
evaluation = textClust::evaluate_cluster(algorithm, stream, measure=c("numMicroClusters", "purity"), n=1000, assign="micro", type="micro", assignMethod="nn", horizon=100)
evaluation = textClust::evaluate_cluster(algorithm, stream, measure=c("numMicroClusters", "silhouette"), n=1000, assign="micro", type="micro", assignMethod="nn", horizon=100)
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment