Weka is a collection of machine learning algorithms for data mining tasks. The algorithms can either be applied directly to a dataset or called from your own Java code. Weka contains tools for data pre-processing, classification, regression, clustering, association rules, and visualization. It is also well-suited for developing new machine learning schemes.

To evaluate the performance of a classifier on a dataset from command line, you can use something like

java -cp weka.jar; weka.classifiers.Evaluation 
  weka.classifiers.lazy.IBk -t weather.arff -T weather.arff

where the Java option ``cp'' is used to give the location of the Weka jar file. ``weka.classifiers.Evaluation weka.classifiers.lazy.IBk'' is the name of the classifier, ``-t'' is an option in the Evaluation class for giving the training file, ``-T'' is an option for giving the test file. Similarly, you can execute other Weka classes from the command line, look at the documentation of the specific classes for the various options which they take. Look at the link http://www.oefai.at/~alexsee/WEKA/ for a tutorial on using Weka from command line.

Source: Weka FAQ