question: private Instance votedReclassifyExample ( Instance example ) throws Exception { int classVotes [ ] = new int [ getNumClasses ( ) ] ; for ( int i = 0 ; i < classVotes . length ; i ++ ) { classVotes [ i ] = 0 ; } for ( Enumeration < RuleList > e = new WekaEnumeration < RuleList > ( m_DecisionList ) ; e . hasMoreElements ( ) ; ) { RuleList rl = e . nextElement ( ) ; int classValue = ( int ) rl . classifyInstance ( example ) ; if ( classValue >= 0 ) { classVotes [ classValue ] ++ ; } } int maxVote = 0 ; int vote = - 1 ; for ( int i = 0 ; i < classVotes . length ; i ++ ) { if ( classVotes [ i ] > maxVote ) { maxVote = classVotes [ i ] ; vote = i ; } } if ( vote >= 0 ) { example . setClassValue ( vote ) ; } else { throw new Exception ( "Error in instance classification." ) ; } return example ; }
target:  Classify example with maximum vote the following way. With every rule in the decisionlist, it is evaluated if the given instance could be the class of the rule. Finally the class value that receives the highest number of votes is assigned to the example.