public double [ ] getVotesForInstance ( Instance inst ) { DoubleVector combinedVote = new DoubleVector ( ) ; if ( this . trainingWeightSeenByModel > 0.0 ) { for ( int i = 0 ; i < this . ensemble . length ; i ++ ) { if ( this . ensembleWeights [ i ] > 0.0 ) { DoubleVector vote = new DoubleVector ( this . ensemble [ i ] . getVotesForInstance ( inst ) ) ; if ( vote . sumOfValues ( ) > 0.0 ) { vote . normalize ( ) ; //scale weight and prevent overflow vote . scaleValues ( this . ensembleWeights [ i ] / ( 1.0 * this . ensemble . length + 1 ) ) ; combinedVote . addValues ( vote ) ; } } } } combinedVote . normalize ( ) ; return combinedVote . getArrayRef ( ) ; }
Predicts a class for an example .