question: protected void addMissing ( Instances data , int level , boolean predictorMissing , boolean classMissing ) { int classIndex = data . classIndex ( ) ; Random random = new Random ( 1 ) ; for ( int i = 0 ; i < data . numInstances ( ) ; i ++ ) { Instance current = data . instance ( i ) ; for ( int j = 0 ; j < data . numAttributes ( ) ; j ++ ) { if ( ( ( j == classIndex ) && classMissing ) || ( ( j != classIndex ) && predictorMissing ) ) { if ( Math . abs ( random . nextInt ( ) ) % 100 < level ) current . setMissing ( j ) ; } } } }
target:  Add missing values to a dataset.