protected void processChunk ( ) { Classifier addedClassifier = null ; double mse_r = this . computeMseR ( ) ; // Compute weights double candidateClassifierWeight = 1.0 / ( mse_r + Double . MIN_VALUE ) ; for ( int i = 0 ; i < this . learners . length ; i ++ ) { this . weights [ i ] [ 0 ] = 1.0 / ( mse_r + this . computeMse ( this . learners [ ( int ) this . weights [ i ] [ 1 ] ] , this . currentChunk ) + Double . MIN_VALUE ) ; } if ( this . learners . length < this . memberCountOption . getValue ( ) ) { // Train and add classifier addedClassifier = this . addToStored ( this . candidate , candidateClassifierWeight ) ; } else { // Substitute poorest classifier int poorestClassifier = this . getPoorestClassifierIndex ( ) ; if ( this . weights [ poorestClassifier ] [ 0 ] < candidateClassifierWeight ) { this . weights [ poorestClassifier ] [ 0 ] = candidateClassifierWeight ; addedClassifier = this . candidate . copy ( ) ; this . learners [ ( int ) this . weights [ poorestClassifier ] [ 1 ] ] = addedClassifier ; } } // train classifiers for ( int i = 0 ; i < this . learners . length ; i ++ ) { this . trainOnChunk ( this . learners [ ( int ) this . weights [ i ] [ 1 ] ] ) ; } this . classDistributions = null ; this . currentChunk = null ; this . candidate = ( Classifier ) getPreparedClassOption ( this . learnerOption ) ; this . candidate . resetLearning ( ) ; this . enforceMemoryLimit ( ) ; }
Processes a chunk of instances . This method is called after collecting a chunk of examples .