0

I am trying to generate random instances to create a dataset.I try creating it with the next code:

....
Instance tmpInstance = InstanceTools.randomInstance(4);
data.add(tmpInstance);
....

If I print it in the system.out:

[{[0.9539317274046737, 0.7367254963392549, 0.9265618402925881, 0.6691294511669751];null}]

But when I save it to a file, the numbers aren't separated by anything, they are all the numbers together.

net.sf.javaml.tools.data.FileHandler.exportDataset(data, new File("C:/Users/agomez/Desktop/data.csv"));

How can I separate them?

Malte Hartwig
  • 4,477
  • 2
  • 14
  • 30
Asier Gomez
  • 6,034
  • 18
  • 52
  • 105

1 Answers1

0

The javaml Filehandler you use does not provide that option. It is specified here:

http://java-ml.sourceforge.net/api/0.1.5/net/sf/javaml/tools/data/FileHandler.html

If you need CSV output, follow questions like these:

Basically commons-csv or opencsv. But if it's really only numbers, you can probably write your java code.

tkruse
  • 10,222
  • 7
  • 53
  • 80