/** * Returns graph describing the tree. * * @exception Exception if something goes wrong */ @Override public String graph() throws Exception { StringBuffer text = new StringBuffer(); text.append("digraph J48Tree {\n"); if (m_isLeaf) { text.append("N" + m_id + " [label=\"" + "NB model" + "\" " + "shape=box style=filled "); if (m_train != null && m_train.numInstances() > 0) { text.append("data =\n" + m_train + "\n"); text.append(",\n"); } text.append("]\n"); } else { text.append("N" + m_id + " [label=\"" + Utils.backQuoteChars(m_localModel.leftSide(m_train)) + "\" "); if (m_train != null && m_train.numInstances() > 0) { text.append("data =\n" + m_train + "\n"); text.append(",\n"); } text.append("]\n"); graphTree(text); } return text.toString() + "}\n"; }
/** * Returns graph describing the tree. * * @exception Exception if something goes wrong */ @Override public String graph() throws Exception { StringBuffer text = new StringBuffer(); text.append("digraph J48Tree {\n"); if (m_isLeaf) { text.append("N" + m_id + " [label=\"" + "NB model" + "\" " + "shape=box style=filled "); if (m_train != null && m_train.numInstances() > 0) { text.append("data =\n" + m_train + "\n"); text.append(",\n"); } text.append("]\n"); } else { text.append("N" + m_id + " [label=\"" + Utils.backQuoteChars(m_localModel.leftSide(m_train)) + "\" "); if (m_train != null && m_train.numInstances() > 0) { text.append("data =\n" + m_train + "\n"); text.append(",\n"); } text.append("]\n"); graphTree(text); } return text.toString() + "}\n"; }
((NBTreeClassifierTree) m_sons[i]).graphTree(text);
((NBTreeClassifierTree) m_sons[i]).graphTree(text);