/** * Print the models at the leaves * * @return textual description of the leaf models */ public String printLeafModels() { StringBuffer text = new StringBuffer(); if (m_isLeaf) { text.append("\nLeaf number: " + m_id + " "); text.append(m_localModel.toString()); text.append("\n"); } else { for (ClassifierTree m_son : m_sons) { text.append(((NBTreeClassifierTree) m_son).printLeafModels()); } } return text.toString(); }
/** * Print the models at the leaves * * @return textual description of the leaf models */ public String printLeafModels() { StringBuffer text = new StringBuffer(); if (m_isLeaf) { text.append("\nLeaf number: " + m_id + " "); text.append(m_localModel.toString()); text.append("\n"); } else { for (ClassifierTree m_son : m_sons) { text.append(((NBTreeClassifierTree) m_son).printLeafModels()); } } return text.toString(); }
/** * Prints tree structure. */ @Override public String toString() { try { StringBuffer text = new StringBuffer(); if (m_isLeaf) { text.append(": NB"); text.append(m_id); } else { dumpTreeNB(0, text); } text.append("\n" + printLeafModels()); text.append("\n\nNumber of Leaves : \t" + numLeaves() + "\n"); text.append("\nSize of the tree : \t" + numNodes() + "\n"); return text.toString(); } catch (Exception e) { e.printStackTrace(); return "Can't print nb tree."; } }
/** * Prints tree structure. */ @Override public String toString() { try { StringBuffer text = new StringBuffer(); if (m_isLeaf) { text.append(": NB"); text.append(m_id); } else { dumpTreeNB(0, text); } text.append("\n" + printLeafModels()); text.append("\n\nNumber of Leaves : \t" + numLeaves() + "\n"); text.append("\nSize of the tree : \t" + numNodes() + "\n"); return text.toString(); } catch (Exception e) { e.printStackTrace(); return "Can't print nb tree."; } }