Ken (Chanoch) Bloom's Blog

30th May 2007

Idea: WekaBuilder (for Groovy)

UPDATE: I have a preliminary version of this sitting on my hard drive.

Create a Groovy builder for complicated machine learning problem setups. This would let you do things like have an AttributeSelectedClassifier or a metaclassifier (which includes other classifiers) in a clean tree-like way, without having to specify things on the command-line and get lost in the noise.

For example

Instances data = ...  // from somewhere
AttributeSelectedClassifier classifier = new AttributeSelectedClassifier();
CfsSubsetEval eval = new CfsSubsetEval();
GreedyStepwise search = new GreedyStepwise();
search.setSearchBackwards(true);

J48 base = new J48();
classifier.setClassifier(base);
classifier.setEvaluator(eval);
classifier.setSearch(search);
// 10-fold cross-validation
Evaluation evaluation = new Evaluation(data);
evaluation.crossValidateModel(classifier, data, 10, new Random(1));
System.out.println(evaluation.toSummaryString());

could become

def data=//...
builder=new WekaBuilder()
classifier=attributeSelectedClassifier{
    cfsSubsetEval //eval
    greedyStepWise //search
    j48 //classifier
}

e=new Evaluation()
e.crossValidateModel(classifier, data, 10, new Random(1))
println e.toSummaryString()

and things get simpler when you start adding options to these subclassifiers.

Permalink | ideas.
My Website Archives

Tags