@Override
    public void fit(DataSetIterator iterator) {
        S.Builder featureNormBuilder = newBuilder();
        S.Builder labelNormBuilder = newBuilder();

        iterator.reset();
        while (iterator.hasNext()) {
            DataSet next = iterator.next();
            featureNormBuilder.addFeatures(next);
            if (fitLabels) {
                labelNormBuilder.addLabels(next);
            }
        }
        featureStats = (S) featureNormBuilder.build();
        if (fitLabels) {
            labelStats = (S) labelNormBuilder.build();
        }
        iterator.reset();
    }
@ Override public void fit ( DataSetIterator iterator ) { S . Builder featureNormBuilder = newBuilder ( ) ; S . Builder labelNormBuilder = newBuilder ( ) ; iterator . reset ( ) ; while ( iterator . hasNext ( ) ) { DataSet next = iterator . next ( ) ; featureNormBuilder . addFeatures ( next ) ; if ( fitLabels ) { labelNormBuilder . addLabels ( next ) ; } } featureStats = ( S ) featureNormBuilder . build ( ) ; if ( fitLabels ) { labelStats = ( S ) labelNormBuilder . build ( ) ; } iterator . reset ( ) ; }
Fit the given model

@param iterator for the data to iterate over