/** * As classification data set dataset. * * @param featurizer the featurizer * @param labelAttributeType the label attribute * @return the dataset */ default Dataset<Instance> asClassificationDataSet( @NonNull Featurizer<HString> featurizer, @NonNull AttributeType labelAttributeType) { return Dataset.classification() .type(getDataSetType()) .source(asLabeledStream(labelAttributeType).map(featurizer::extractLabeled)) .build(); }
/** * As classification data set dataset. * * @param featurizer the featurizer * @param labelFunction the label function * @return the dataset */ default Dataset<Instance> asClassificationDataSet( @NonNull Featurizer<HString> featurizer, @NonNull SerializableFunction<HString, Object> labelFunction) { return Dataset.classification() .type(getDataSetType()) .source(asLabeledStream(labelFunction).map(featurizer::extractLabeled)) .build(); }
/** * As classification data set dataset. * * @param featurizer the featurizer * @return the dataset */ default Dataset<Instance> asClassificationDataSet(@NonNull Featurizer<HString> featurizer) { return Dataset.classification() .type(getDataSetType()) .source(stream().map(featurizer::extract)) .build(); }