Ejemplo n.º 1
0
 /**
  * As regression data set dataset.
  *
  * @param featurizer the featurizer
  * @param labelAttributeType the label attribute
  * @return the dataset
  */
 default Dataset<Instance> asRegressionDataSet(
     @NonNull Featurizer<HString> featurizer, @NonNull AttributeType labelAttributeType) {
   return Dataset.regression()
       .type(getDataSetType())
       .source(asLabeledStream(labelAttributeType).map(featurizer::extractLabeled))
       .build();
 }
Ejemplo n.º 2
0
 /**
  * As regression data set dataset.
  *
  * @param featurizer the featurizer
  * @param labelFunction the label function
  * @return the dataset
  */
 default Dataset<Instance> asRegressionDataSet(
     @NonNull Featurizer<HString> featurizer,
     @NonNull SerializableFunction<HString, Double> labelFunction) {
   return Dataset.regression()
       .type(getDataSetType())
       .source(asLabeledStream(labelFunction).map(featurizer::extractLabeled))
       .build();
 }
Ejemplo n.º 3
0
 /**
  * As sequence data set dataset.
  *
  * @param sequenceType the sequence type
  * @param featurizer the featurizer
  * @return the dataset
  */
 default Dataset<Sequence> asSequenceDataSet(
     @NonNull AnnotationType sequenceType, @NonNull SequenceFeaturizer<Annotation> featurizer) {
   return Dataset.sequence()
       .type(getDataSetType())
       .source(
           asSequenceStream(sequenceType).map(seq -> featurizer.extractSequence(seq.iterator())))
       .build();
 }
Ejemplo n.º 4
0
 /**
  * As sequence data set dataset.
  *
  * @param labelFunction the label function
  * @param featurizer the featurizer
  * @return the dataset
  */
 default Dataset<Sequence> asSequenceDataSet(
     @NonNull Function<? super Annotation, String> labelFunction,
     @NonNull SequenceFeaturizer<Annotation> featurizer) {
   return Dataset.sequence()
       .type(getDataSetType())
       .source(
           asSequenceStream(labelFunction).map(seq -> featurizer.extractSequence(seq.iterator())))
       .build();
 }
Ejemplo n.º 5
0
 /**
  * As regression data set dataset.
  *
  * @param featurizer the featurizer
  * @return the dataset
  */
 default Dataset<Instance> asRegressionDataSet(@NonNull Featurizer<HString> featurizer) {
   return Dataset.regression()
       .type(getDataSetType())
       .source(stream().map(featurizer::extract))
       .build();
 }