You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I used your code, I found a potential bug of 0 divided by 0:
Exception in thread "main" java.lang.ArithmeticException: / by zero
at moa.clusterers.dstream.Dstream.trainOnInstanceImpl(Dstream.java:348)
at moa.clusterers.AbstractClusterer.trainOnInstance(AbstractClusterer.java:131)
at mytest.TestDStream.main(TestDStream.java:24)
My testing code is:
packagemytest;
importcom.yahoo.labs.samoa.instances.Instance;
importmoa.cluster.Clustering;
importmoa.clusterers.dstream.Dstream;
importmoa.streams.clustering.ClusteringStream;
importmoa.streams.clustering.FileStream;
publicclassTestDStream {
publicstaticvoidmain(String[] args) {
FileStreamfStream = newFileStream();
fStream.arffFileOption.setValue("test.arff");// set the ARFF file namefStream.normalizeOption.setValue(false);// set normalized to be true or falsefStream.prepareForUse();
intnumLines = 0;
//DStreamDstreamdstream = newDstream();
dstream.resetLearning();
ClusteringStreamstream = fStream;
while (stream.hasMoreInstances()) {
Instancecurr = stream.nextInstance().getData();
dstream.trainOnInstance(curr);
numLines++;
}
ClusteringresDstream = dstream.getClusteringResult();
dstream.getMicroClusteringResult();
System.out.println("Size of result from Dstream: " + resDstream.size());
System.out.println(numLines + " lines have been read");
}
}
Thanks.
The text was updated successfully, but these errors were encountered:
As mentioned there, the error uncovered occurred when the procedure to calculate gap produces a zero. This has been modified so that gap cannot be set to zero: if the procedure produces a zero, gap will instead be set to one.
Hi!
When I used your code, I found a potential bug of 0 divided by 0:
Exception in thread "main" java.lang.ArithmeticException: / by zero
at moa.clusterers.dstream.Dstream.trainOnInstanceImpl(Dstream.java:348)
at moa.clusterers.AbstractClusterer.trainOnInstance(AbstractClusterer.java:131)
at mytest.TestDStream.main(TestDStream.java:24)
My testing code is:
Thanks.
The text was updated successfully, but these errors were encountered: