Weka Java API

In this Tutorial i am going to show how to convert ARFF file format to CSV file Format.

  •  First Create Object  for ArffLoader class
  • then set the particular Arff file from your location
  • Load Instance class
  •  Finally Create CSV class load the instances data and wirteBatch.



package com.weka;

import java.io.File;
import java.io.IOException;

import weka.core.Instances;
import weka.core.converters.ArffLoader;
import weka.core.converters.CSVSaver;

public class ArfftoCsv {

    public static void main(String[] args) throws IOException {
       
       
       
        ArffLoader loader=new ArffLoader();
        loader.setSource(new File("D:\\SiteInfoCMS.arff"));
        Instances data=loader.getDataSet();
       
      CSVSaver save=new CSVSaver();
      save.setInstances(data);
      save.setFile(new File("D:\\SiteInfoCMS.csv"));
      save.writeBatch();
       
    }

}




Comments

Popular posts from this blog

Innovaminex - Cryptocurrency in precious metal mines

LivenPay (LVN) - Spending and earning money instantly

LivenPay ICO Project