List of usage examples for weka.classifiers.trees RandomTree setNumFolds
public void setNumFolds(int newNumFolds)
From source file:controller.MineroControler.java
public String clasificardorArbolAleat(String atributo) { BufferedReader breader = null; Instances datos = null;// w ww . j av a 2 s .c o m breader = new BufferedReader(fuente_arff); try { datos = new Instances(breader); Attribute atr = datos.attribute(atributo); datos.setClass(atr); //datos.setClassIndex(0); } catch (IOException ex) { System.err.println("Problemas al intentar cargar los datos"); return null; } RandomTree arbol = new RandomTree(); // Class for constructing a tree that considers K randomly chosen attributes at each node. try { arbol.setNumFolds(100); arbol.setKValue(0); arbol.setMinNum(1); arbol.setMaxDepth(0); arbol.setSeed(1); arbol.buildClassifier(datos); } catch (Exception ex) { System.err.println("Problemas al ejecutar algorimo de clasificacion" + ex.getLocalizedMessage()); } return arbol.toString(); }