/** * Main method for this class. * * @param argv the commandline parameters */ public static void main(String[] argv) { runClassifier(new RandomTree(), argv); } }
/** * Returns the tip text for this property * * @return tip text for this property suitable for displaying in the * explorer/experimenter gui */ public String numFeaturesTipText() { return ((RandomTree) getClassifier()).KValueTipText(); }
/** * Returns the tip text for this property * * @return tip text for this property suitable for displaying in the * explorer/experimenter gui */ public String breakTiesRandomlyTipText() { return ((RandomTree) getClassifier()).breakTiesRandomlyTipText(); }
/** * Returns default capabilities of the base classifier. * * @return the capabilities of the base classifier */ public Capabilities getCapabilities() { // Cannot use the main RandomTree object because capabilities checking has // been turned off // for that object. return (new RandomTree()).getCapabilities(); }
result.add("" + getKValue()); result.add("" + getMinNum()); result.add("" + getMinVarianceProp()); result.add("" + getSeed()); if (getMaxDepth() > 0) { result.add("-depth"); result.add("" + getMaxDepth()); if (getNumFolds() > 0) { result.add("-N"); result.add("" + getNumFolds()); if (getAllowUnclassifiedInstances()) { result.add("-U"); if (getBreakTiesRandomly()) { result.add("-B");
((RandomTree) AbstractClassifier.forName(defaultClassifierString(), options)); classifier.setComputeImpurityDecreases(m_computeAttributeImportance); setDoNotCheckCapabilities(classifier.getDoNotCheckCapabilities()); setSeed(classifier.getSeed()); setDebug(classifier.getDebug()); setNumDecimalPlaces(classifier.getNumDecimalPlaces()); setBatchSize(classifier.getBatchSize()); classifier.setDoNotCheckCapabilities(true);
/** * Constructor that sets base classifier for bagging to RandomTre and default * number of iterations to 100. */ public RandomForest() { RandomTree rTree = new RandomTree(); rTree.setDoNotCheckCapabilities(true); super.setClassifier(rTree); super.setRepresentCopiesUsingWeights(true); setNumIterations(defaultNumberOfIterations()); }
RandomTree.singleVariance(totalSum, totalSumSquared, totalSumOfWeights); ((getMaxDepth() > 0) && (depth >= getMaxDepth()))) { || ((!getBreakTiesRandomly()) && (currVal == val) && (attIndex < bestIndex))) { val = currVal; bestIndex = attIndex;
/** * Constructor. */ public RandomCommittee() { m_Classifier = new weka.classifiers.trees.RandomTree(); }
getCapabilities().testWithFail(data); if (data.classAttribute().isNumeric()) { trainVariance = RandomTree.singleVariance(classProbs[0], totalSumSquared, totalWeight) / totalWeight; classProbs[0] /= totalWeight;
RandomTree.singleVariance(totalSum, totalSumSquared, totalSumOfWeights); if (getAllowUnclassifiedInstances()) { m_ClassDistribution = null; return;
/** * Builds the classifier to generate a partition. */ @Override public void generatePartition(Instances data) throws Exception { buildClassifier(data); }
/** * Get whether to break ties randomly. * * @return true if ties are to be broken randomly. */ public boolean getBreakTiesRandomly() { return ((RandomTree) getClassifier()).getBreakTiesRandomly(); }
if (getAllowUnclassifiedInstances()) { double[] result = new double[m_Info.numClasses()]; if (m_Info.classAttribute().isNumeric()) {
result.add("" + getKValue()); result.add("" + getMinNum()); result.add("" + getMinVarianceProp()); result.add("" + getSeed()); if (getMaxDepth() > 0) { result.add("-depth"); result.add("" + getMaxDepth()); if (getNumFolds() > 0) { result.add("-N"); result.add("" + getNumFolds()); if (getAllowUnclassifiedInstances()) { result.add("-U"); if (getBreakTiesRandomly()) { result.add("-B");
((RandomTree) AbstractClassifier.forName(defaultClassifierString(), options)); classifier.setComputeImpurityDecreases(m_computeAttributeImportance); setDoNotCheckCapabilities(classifier.getDoNotCheckCapabilities()); setSeed(classifier.getSeed()); setDebug(classifier.getDebug()); setNumDecimalPlaces(classifier.getNumDecimalPlaces()); setBatchSize(classifier.getBatchSize()); classifier.setDoNotCheckCapabilities(true);
/** * Constructor that sets base classifier for bagging to RandomTre and default * number of iterations to 100. */ public RandomForest() { RandomTree rTree = new RandomTree(); rTree.setDoNotCheckCapabilities(true); super.setClassifier(rTree); super.setRepresentCopiesUsingWeights(true); setNumIterations(defaultNumberOfIterations()); }
/** * Returns default capabilities of the base classifier. * * @return the capabilities of the base classifier */ public Capabilities getCapabilities() { // Cannot use the main RandomTree object because capabilities checking has // been turned off // for that object. return (new RandomTree()).getCapabilities(); }
RandomTree.singleVariance(totalSum, totalSumSquared, totalSumOfWeights); ((getMaxDepth() > 0) && (depth >= getMaxDepth()))) { || ((!getBreakTiesRandomly()) && (currVal == val) && (attIndex < bestIndex))) { val = currVal; bestIndex = attIndex;
/** * Constructor. */ public RandomCommittee() { m_Classifier = new weka.classifiers.trees.RandomTree(); }