@Override
    protected void _transform(Dataframe newData) {
        Set<Object> selectedFeatures = knowledgeBase.getModelParameters().getFeatureScores().keySet();
        StorageEngine storageEngine = knowledgeBase.getStorageEngine();
        Set<TypeInference.DataType> supportedXDataTypes = getSupportedXDataTypes();

        Map<Object, Boolean> tmp_removedColumns = storageEngine.getBigMap("tmp_removedColumns", Object.class, Boolean.class, StorageEngine.MapType.HASHMAP, StorageEngine.StorageHint.IN_MEMORY, true, true);

        //keep only the columns which are compatible with the algorithm
        Stream<Object> compatibleColumns = newData.getXDataTypes().entrySet().stream()
            .filter(e -> supportedXDataTypes.contains(e.getValue()))
            .map(e -> e.getKey());

        streamExecutor.forEach(StreamMethods.stream(compatibleColumns, isParallelized()), column -> {
            if(!selectedFeatures.contains(column)) {
                tmp_removedColumns.put(column, true);
            }
        });

        logger.debug("Removing Columns");
        newData.dropXColumns(tmp_removedColumns.keySet());

        storageEngine.dropBigMap("tmp_removedColumns", tmp_removedColumns);
    }
@ Override protected void _transform ( Dataframe newData ) { Set < Object > selectedFeatures = knowledgeBase . getModelParameters ( ) . getFeatureScores ( ) . keySet ( ) ; StorageEngine storageEngine = knowledgeBase . getStorageEngine ( ) ; Set < TypeInference . DataType > supportedXDataTypes = getSupportedXDataTypes ( ) ; Map < Object , Boolean > tmp_removedColumns = storageEngine . getBigMap ( "tmp_removedColumns" , Object . class , Boolean . class , StorageEngine . MapType . HASHMAP , StorageEngine . StorageHint . IN_MEMORY , true , true ) ; Stream < Object > compatibleColumns = newData . getXDataTypes ( ) . entrySet ( ) . stream ( ) . filter ( e -> supportedXDataTypes . contains ( e . getValue ( ) ) ) . map ( e -> e . getKey ( ) ) ; streamExecutor . forEach ( StreamMethods . stream ( compatibleColumns , isParallelized ( ) ) , column -> { if ( ! selectedFeatures . contains ( column ) ) { tmp_removedColumns . put ( column , true ) ; } } ) ; logger . debug ( "Removing Columns" ) ; newData . dropXColumns ( tmp_removedColumns . keySet ( ) ) ; storageEngine . dropBigMap ( "tmp_removedColumns" , tmp_removedColumns ) ; }
{@inheritDoc}