private double [ ] getVotesForInstance ( Instance instance ) { ErrorWeightedVote errorWeightedVote = newErrorWeightedVote ( ) ; int numberOfRulesCovering = 0 ; for ( ActiveRule rule : ruleSet ) { if ( rule . isCovering ( instance ) == true ) { numberOfRulesCovering ++ ; double [ ] vote = rule . getPrediction ( instance ) ; double error = rule . getCurrentError ( ) ; errorWeightedVote . addVote ( vote , error ) ; if ( ! this . unorderedRules ) { // Ordered Rules Option. break ; // Only one rule cover the instance. } } } if ( numberOfRulesCovering == 0 ) { double [ ] vote = defaultRule . getPrediction ( instance ) ; double error = defaultRule . getCurrentError ( ) ; errorWeightedVote . addVote ( vote , error ) ; } double [ ] weightedVote = errorWeightedVote . computeWeightedVote ( ) ; return weightedVote ; }
getVotesForInstance extension of the instance method getVotesForInstance in moa . classifier . java returns the prediction of the instance . Called in EvaluateModelRegression