/** * Get the maximum depth of trh tree, 0 for unlimited. * * @return the maximum depth. */ public int getMaxDepth() { return ((RandomTree) getClassifier()).getMaxDepth(); }
/** * Get the maximum depth of trh tree, 0 for unlimited. * * @return the maximum depth. */ public int getMaxDepth() { return ((RandomTree) getClassifier()).getMaxDepth(); }
/** * Outputs the decision tree. * * @return a string representation of the classifier */ @Override public String toString() { // only ZeroR model? if (m_zeroR != null) { StringBuffer buf = new StringBuffer(); buf.append(this.getClass().getName().replaceAll(".*\\.", "") + "\n"); buf.append(this.getClass().getName().replaceAll(".*\\.", "") .replaceAll(".", "=") + "\n\n"); buf .append("Warning: No model could be built, hence ZeroR model is used:\n\n"); buf.append(m_zeroR.toString()); return buf.toString(); } if (m_Tree == null) { return "RandomTree: no model has been built yet."; } else { return "\nRandomTree\n==========\n" + m_Tree.toString(0) + "\n" + "\nSize of the tree : " + m_Tree.numNodes() + (getMaxDepth() > 0 ? ("\nMax depth of tree: " + getMaxDepth()) : ("")); } }
/** * Outputs the decision tree. * * @return a string representation of the classifier */ @Override public String toString() { // only ZeroR model? if (m_zeroR != null) { StringBuffer buf = new StringBuffer(); buf.append(this.getClass().getName().replaceAll(".*\\.", "") + "\n"); buf.append(this.getClass().getName().replaceAll(".*\\.", "") .replaceAll(".", "=") + "\n\n"); buf .append("Warning: No model could be built, hence ZeroR model is used:\n\n"); buf.append(m_zeroR.toString()); return buf.toString(); } if (m_Tree == null) { return "RandomTree: no model has been built yet."; } else { return "\nRandomTree\n==========\n" + m_Tree.toString(0) + "\n" + "\nSize of the tree : " + m_Tree.numNodes() + (getMaxDepth() > 0 ? ("\nMax depth of tree: " + getMaxDepth()) : ("")); } }
result.add("" + getSeed()); if (getMaxDepth() > 0) { result.add("-depth"); result.add("" + getMaxDepth());
result.add("" + getSeed()); if (getMaxDepth() > 0) { result.add("-depth"); result.add("" + getMaxDepth());
((getMaxDepth() > 0) && (depth >= getMaxDepth()))) {
((getMaxDepth() > 0) && (depth >= getMaxDepth()))) {