@Override public String graph() throws Exception {
  StringBuffer text=new StringBuffer();
  assignIDs(-1);
  text.append("digraph J48Tree {\n");
  if (m_isLeaf) {
    text.append("N" + m_id + " [label=\""+ Utils.backQuoteChars(m_localModel.dumpLabel(0,m_train))+ "\" "+ "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";
}

@ Override public String graph ( ) throws Exception { StringBuffer text = new StringBuffer ( ) ; assignIDs ( - 1 ) ; text . append ( "digraph J48Tree {\n" ) ; if ( m_isLeaf ) { text . append ( "N" + m_id + " [label=\"" + Utils . backQuoteChars ( m_localModel . dumpLabel ( 0 , m_train ) ) + "\" " + "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 .
