Posts

Showing posts from April, 2017

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();               CSVSa...

Weka Java API

erqer

Weka Java API

Weka Java API:      First we download Weka Jar from this site http://www.java2s.com/Code/Jar/w/Downloadwekajar.htm Configure the jar from your java project build path. Now we start Java Program CSV File to ARFF File Format package com.weka; import java.io.File; import java.io.IOException; import weka.core.Instances; import weka.core.converters.ArffSaver; import weka.core.converters.CSVLoader; public class CSVTOARFF {     public static void main(String[] args) throws IOException { // Load the CSV File from your local Drive.         CSVLoader load=new CSVLoader();     //    Set the         load.setSource(new File("D:\\Site.csv"));         Instances data=load.getDataSet();                 ArffSaver saver=new ArffSaver();         ...

Connect Weka to Database

Image
Trying to Connect weka in Mysql Database:         I) Go to the particular weka path in program files folder.then extract WEKA.jar then only your database is connecting otherwise it won't connect (Because i am also facing the same kind of error. when i am connect mysql database).      II ) Then Open the weka Explorer  click open db button  The Windows showing Like this       I) Set the URL : jdbc:mysql://localhost:3306/sample1234(your database Name)      II ) Enter the Username and Password.i will give root root .      III)  Excute the query   SELECT * FROM sample1234.blog;       IV) Finally it showing the exact output  

Weka Install In Windows 7 OS

Steps to install weka in Windows 7 OS:      I ) Go to this website:   http://www.cs.waikato.ac.nz/~ml/weka/downloading.html    download latest version of weka software.   II ) Start to install weka its a normal installation .while install time they require update version of Java JDK .  III) Now i am download this are the software and jar..                              I ) weka-3-8-1jre-x64                             II ) mysql-connector-java-5.1.41 jar download from this site https://dev.mysql.com/downloads/connector/j/3.1.html IV) After install weka software.extract the mysql connector folder put in to the weka software folder. V) Then open RunWeka.ini File configure the mysql connector in weka classpath   ...