@ Override public void binarize ( double cutoff ) { INDArray linear = getFeatureMatrix ( ) . linearView ( ) ; for ( int i = 0 ; i < getFeatures ( ) . length ( ) ; i ++ ) { double curr = linear . getDouble ( i ) ; if ( curr > cutoff ) getFeatures ( ) . putScalar ( i , 1 ) ; else getFeatures ( ) . putScalar ( i , 0 ) ; } }
Binarizes the dataset such that any number greater than cutoff is 1 otherwise zero