Posts

Showing posts from March, 2015

Implementing X-means clustering in Java using WEKA API.

This post shows how to run x-means clustering algorithm in Java using Weka. Prepare your data properly and use the following code to run x-means clustering algorithm. The output is the instance and their corresponding cluster. import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import weka.clusterers.XMeans; import weka.core.Instances; public class Cluster {     public static BufferedReader readDataFile(String filename)     {         BufferedReader inputReader = null;         try         {             inputReader = new BufferedReader(new FileReader(filename));         }         catch (FileNotFoundException ex)         {             System.er...

Text Mining Classification Implementation in Java Using WEKA

This tutorial contains the implementation of Text Mining using WEKA tool. The basic steps are given below: 1.                   Preprocessing : 1.                   Remove Special Characters. 2.                   Remove stop words. 3.                   Tokenize data. 4.                   Stemming using LovinsStemmer of WEKA 2.                   Identify Distinct Words. 3.             ...