private int getClassFromVotes ( double votes [ ] ) { double maxVote = - 1 ; int maxVoteClass = - 1 ; for ( int i = 0 ; i < votes . length ; i ++ ) { if ( votes [ i ] > maxVote ) { maxVote = votes [ i ] ; maxVoteClass = i ; } } return maxVoteClass ; }
Returns the class with maximum vote .