@Override public String toString(){
  try {
    StringBuffer text=new StringBuffer();
    text.append(m_attr.name() + ":\n");
    for (int v=0; v < m_classifications.length; v++) {
      text.append("\t");
      if (m_attr.isNominal()) {
        text.append(m_attr.value(v));
      }
 else       if (v < m_breakpoints.length) {
        text.append("< " + m_breakpoints[v]);
      }
 else       if (v > 0) {
        text.append(">= " + m_breakpoints[v - 1]);
      }
 else {
        text.append("not ?");
      }
      text.append("\t-> " + m_class.value(m_classifications[v]) + "\n");
    }
    if (m_missingValueClass != -1) {
      text.append("\t?\t-> " + m_class.value(m_missingValueClass) + "\n");
    }
    text.append("(" + m_correct + "/"+ m_numInst+ " instances correct)\n");
    return text.toString();
  }
 catch (  Exception e) {
    return "Can't print OneR classifier!";
  }
}

@ Override public String toString ( ) { try { StringBuffer text = new StringBuffer ( ) ; text . append ( m_attr . name ( ) + ":\n" ) ; for ( int v = 0 ; v < m_classifications . length ; v ++ ) { text . append ( "\t" ) ; if ( m_attr . isNominal ( ) ) { text . append ( m_attr . value ( v ) ) ; } else if ( v < m_breakpoints . length ) { text . append ( "< " + m_breakpoints [ v ] ) ; } else if ( v > 0 ) { text . append ( ">= " + m_breakpoints [ v - 1 ] ) ; } else { text . append ( "not ?" ) ; } text . append ( "\t-> " + m_class . value ( m_classifications [ v ] ) + "\n" ) ; } if ( m_missingValueClass != - 1 ) { text . append ( "\t?\t-> " + m_class . value ( m_missingValueClass ) + "\n" ) ; } text . append ( "(" + m_correct + "/" + m_numInst + " instances correct)\n" ) ; return text . toString ( ) ; } catch ( Exception e ) { return "Can't print OneR classifier!" ; } }
returns a description of the rule .
