@Override public String toString(){
  if (m_rules == null) {
    return "FPGrowth hasn't been trained yet!";
  }
  StringBuffer result=new StringBuffer();
  int numRules=(m_rules.size() < m_numRulesToFind) ? m_rules.size() : m_numRulesToFind;
  if (m_rules.size() == 0) {
    return "No rules found!";
  }
 else {
    result.append("FPGrowth found " + m_rules.size() + " rules");
    if (!m_findAllRulesForSupportLevel) {
      result.append(" (displaying top " + numRules + ")");
    }
    if (m_transactionsMustContain.length() > 0 || m_rulesMustContain.length() > 0) {
      result.append("\n");
      if (m_transactionsMustContain.length() > 0) {
        result.append("\nUsing only transactions that contain: " + m_transactionsMustContain);
      }
      if (m_rulesMustContain.length() > 0) {
        result.append("\nShowing only rules that contain: " + m_rulesMustContain);
      }
    }
    result.append("\n\n");
  }
  int count=0;
  for (  AssociationRule r : m_rules) {
    result.append(Utils.doubleToString((double)count + 1,(int)(Math.log(numRules) / Math.log(10) + 1),0) + ". ");
    result.append(r + "\n");
    count++;
    if (!m_findAllRulesForSupportLevel && count == m_numRulesToFind) {
      break;
    }
  }
  return result.toString();
}

@ Override public String toString ( ) { if ( m_rules == null ) { return "FPGrowth hasn't been trained yet!" ; } StringBuffer result = new StringBuffer ( ) ; int numRules = ( m_rules . size ( ) < m_numRulesToFind ) ? m_rules . size ( ) : m_numRulesToFind ; if ( m_rules . size ( ) == 0 ) { return "No rules found!" ; } else { result . append ( "FPGrowth found " + m_rules . size ( ) + " rules" ) ; if ( ! m_findAllRulesForSupportLevel ) { result . append ( " (displaying top " + numRules + ")" ) ; } if ( m_transactionsMustContain . length ( ) > 0 || m_rulesMustContain . length ( ) > 0 ) { result . append ( "\n" ) ; if ( m_transactionsMustContain . length ( ) > 0 ) { result . append ( "\nUsing only transactions that contain: " + m_transactionsMustContain ) ; } if ( m_rulesMustContain . length ( ) > 0 ) { result . append ( "\nShowing only rules that contain: " + m_rulesMustContain ) ; } } result . append ( "\n\n" ) ; } int count = 0 ; for ( AssociationRule r : m_rules ) { result . append ( Utils . doubleToString ( ( double ) count + 1 , ( int ) ( Math . log ( numRules ) / Math . log ( 10 ) + 1 ) , 0 ) + ". " ) ; result . append ( r + "\n" ) ; count ++ ; if ( ! m_findAllRulesForSupportLevel && count == m_numRulesToFind ) { break ; } } return result . toString ( ) ; }
output the association rules .
