protected double [ ] getBestSecondBestEntropy ( DoubleVector entropy ) { double [ ] entropyValues = new double [ 2 ] ; double best = Double . MAX_VALUE ; double secondBest = Double . MAX_VALUE ; for ( int i = 0 ; i < entropy . numValues ( ) ; i ++ ) { if ( entropy . getValue ( i ) < best ) { secondBest = best ; best = entropy . getValue ( i ) ; } else { if ( entropy . getValue ( i ) < secondBest ) { secondBest = entropy . getValue ( i ) ; } } } entropyValues [ 0 ] = best ; entropyValues [ 1 ] = secondBest ; return entropyValues ; }
Get best and second best attributes