question: public Distribution ( Instances source , ClassifierSplitModel modelToUse ) throws Exception { int index ; Instance instance ; double [ ] weights ; m_perClassPerBag = new double [ modelToUse . numSubsets ( ) ] [ 0 ] ; m_perBag = new double [ modelToUse . numSubsets ( ) ] ; totaL = 0 ; m_perClass = new double [ source . numClasses ( ) ] ; for ( int i = 0 ; i < modelToUse . numSubsets ( ) ; i ++ ) { m_perClassPerBag [ i ] = new double [ source . numClasses ( ) ] ; } Enumeration < Instance > enu = source . enumerateInstances ( ) ; while ( enu . hasMoreElements ( ) ) { instance = enu . nextElement ( ) ; index = modelToUse . whichSubset ( instance ) ; if ( index != - 1 ) { add ( index , instance ) ; } else { weights = modelToUse . weights ( instance ) ; addWeights ( instance , weights ) ; } } }
target:  Creates a distribution according to given instances and split model.