当前位置: 动力学知识库 > 问答 > 编程问答 >

r - Apply a cluster(clustream) on a csv data

问题描述:

I would like to train my cluster(clustream in my case) on a specific csv data and then test it on a diffrent csv test data.

here is my code:

library("stream")

library("streamMOA")

library("RMOA")

setwd("baaa")

dsd <- DSD_ReadCSV("TRAIN.csv", k=NA, take=NULL, class=NULL, loop=FALSE,

sep=",", header=TRUE, skip=0, colClasses = c("NULL",rep(NA,55)))

reset_stream(dsd)

# pay attention that t1 is a parameter set to 1

t1 <- 1

clustream <- DSC_CluStream(t=t1, m=100, k=23, horizon=500)

update(clustream, dsd, 55)

#start test:

the update(clustream, dsd, 55) not working well, this is the way to train the cluster on a data? and how could i test it? the meaning of "test it" is to get eventually the cluster id for each record in the test set.

thanks.

网友答案:

I also came across same problem for different data set, can i know the solution

cluster with CluStream

 stream <- DSD_ReadCSV("2c9b0cf998ef4370817f9f41d64fc0a0.csv",header = TRUE,sep=",") 
clustream <- DSC_CluStream(m=50)
update(clustream, stream, 500)
Error in .jcall("StreamMOA", "V", "update", object$javaObj,.jarray(as.matrix(d),  : 

method update with signature (Lmoa/clusterers/AbstractClusterer;[[Ljava.lang.String;)V not found

分享给朋友:
您可能感兴趣的文章:
随机阅读: