public void dropXColumns ( Set < Object > columnSet ) { columnSet . retainAll ( data . xDataTypes . keySet ( ) ) ; //keep only those columns that are already known to the Meta data of the Dataframe if ( columnSet . isEmpty ( ) ) { return ; } //remove all the columns from the Meta data data . xDataTypes . keySet ( ) . removeAll ( columnSet ) ; streamExecutor . forEach ( StreamMethods . stream ( entries ( ) , true ) , e -> { Integer rId = e . getKey ( ) ; Record r = e . getValue ( ) ; AssociativeArray xData = r . getX ( ) . copy ( ) ; boolean modified = xData . keySet ( ) . removeAll ( columnSet ) ; if ( modified ) { Record newR = new Record ( xData , r . getY ( ) , r . getYPredicted ( ) , r . getYPredictedProbabilities ( ) ) ; //safe to call in this context. we already updated the meta when we modified the xDataTypes _unsafe_set ( rId , newR ) ; } } ) ; }
Removes completely a list of columns from the dataset . The meta - data of the Dataframe are updated . The method internally uses threads .