@ Override public DataSet filterBy ( int [ ] labels ) { List < DataSet > list = asList ( ) ; List < DataSet > newList = new ArrayList <> ( ) ; List < Integer > labelList = new ArrayList <> ( ) ; for ( int i : labels ) labelList . ( i ) ; for ( DataSet d : list ) { int outcome = d . outcome ( ) ; if ( labelList . contains ( outcome ) ) { newList . add ( d ) ; } } return DataSet . merge ( newList ) ; }
Strips the data transform of all but the passed in labels