private void writeNumericalBucketFeature()

in src/main/java/com/amazonaws/services/neptune/profiles/neptune_ml/v2/PropertyGraphTrainingDataConfigWriterV2.java [486:528]


    private void writeNumericalBucketFeature(PropertySchema propertySchema, NumericalBucketFeatureConfigV2 numericalBucketSpecification) throws IOException {

        if (propertySchema.isMultiValue()) {
            warnings.add(String.format("%s feature does not support multi-value properties. Auto-inferring a feature for '%s'.", FeatureTypeV2.bucket_numerical, propertySchema.nameWithoutDataType()));
            writeAutoInferredFeature(propertySchema);
            return;
        }

        generator.writeStartObject();

        writeFeature(propertySchema, FeatureTypeV2.bucket_numerical);

        Range range = numericalBucketSpecification.range();

        if (range != null) {
            generator.writeArrayFieldStart("range");
            generator.writeObject(range.low());
            generator.writeObject(range.high());
            generator.writeEndArray();
        }

        Integer bucketCount = numericalBucketSpecification.bucketCount();

        if (bucketCount != null) {
            generator.writeNumberField("bucket_cnt", bucketCount);
        }

        Integer slideWindowSize = numericalBucketSpecification.slideWindowSize();

        if (slideWindowSize != null) {
            generator.writeNumberField("slide_window_size", slideWindowSize);
        }

        ImputerTypeV2 imputer = numericalBucketSpecification.imputerType();

        if (imputer != null && imputer != ImputerTypeV2.none) {
            generator.writeStringField("imputer", imputer.formattedName());
        } else {
            warnings.add(String.format("'imputer' value missing for %s feature for '%s'. Preprocessing will exit when it encounters an missing value.", FeatureTypeV2.bucket_numerical, propertySchema.nameWithoutDataType()));
        }

        generator.writeEndObject();
    }