wenx999 / moa

Automatically exported from code.google.com/p/moa
0 stars 0 forks source link

RandomRBFGeneratorEvents problem #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Version: 2012.09-SNAPSHOT

RandomRBFGeneratorEvents generates Instance objects correctly. The problem 
occurs when they are generated via noise. In that case 
weka.core.Instance.toString() throws exception, which is annoying because is 
not possible to use WriteStreamToARFFFile for example.

Here is an example:

import moa.streams.clustering.RandomRBFGeneratorEvents;
import weka.core.Instance;

public class InstanceGenerator {

    private RandomRBFGeneratorEvents randomRBFGeneratorEvents;

    public InstanceGenerator() {
        randomRBFGeneratorEvents = new RandomRBFGeneratorEvents();
        //randomRBFGeneratorEvents.noiseLevelOption.setValue(0);
        randomRBFGeneratorEvents.prepareForUse();
    }

    public Instance next() {
        return randomRBFGeneratorEvents.nextInstance();
    }

    public static void main(String[] args) {
        InstanceGenerator generator = new InstanceGenerator();

        for (int i = 0; i < 10; i++) {
            Instance instance = generator.next();
            System.out.println(instance.toString());
        }
    }

}

Original issue reported on code.google.com by AndreFer...@gmail.com on 28 Feb 2013 at 4:44

GoogleCodeExporter commented 9 years ago
Fixed for the new release 13.08.

Original comment by abi...@gmail.com on 22 Aug 2013 at 10:04