List of usage examples for weka.classifiers.functions MultilayerPerceptron setSeed
@Override public void setSeed(int l)
From source file:predictors.HelixPredictor.java
License:Open Source License
/** * Trains the Weka Classifer./* w ww . j a v a 2 s . co m*/ */ public void trainClassifier() { try { MultilayerPerceptron classifier = new weka.classifiers.functions.MultilayerPerceptron(); Instances data = this.dataset; if (data.classIndex() == -1) { data.setClassIndex(data.numAttributes() - 1); } data.randomize(new Random(data.size())); String[] optClassifier = weka.core.Utils .splitOptions("-L 0.01 -M 0.8 -N 256 -V 20 -S 0 -E 5 -H 25 -B -I -D -C"); classifier.setOptions(optClassifier); classifier.setSeed(data.size()); classifier.buildClassifier(data); this.classifier = classifier; this.isTrained = true; } catch (Exception e) { ErrorUtils.printError(HelixPredictor.class, "Training failed", e); } }