encodeAsOneHotLabels function

PipeableOperatorFn encodeAsOneHotLabels({
  1. Iterable<int>? features,
  2. Iterable<String>? featureNames,
  3. String headerPrefix = '',
  4. String headerPostfix = '',
  5. UnknownValueHandlingType unknownValueHandlingType = defaultUnknownValueHandlingType,
})

A factory function to use one hot categorical data encoder in pipeline

Implementation

PipeableOperatorFn encodeAsOneHotLabels({
  Iterable<int>? features,
  Iterable<String>? featureNames,
  String headerPrefix = '',
  String headerPostfix = '',
  UnknownValueHandlingType unknownValueHandlingType =
      defaultUnknownValueHandlingType,
}) => (data, {dtype}) => EncoderImpl(
  data,
  EncoderType.oneHot,
  const SeriesEncoderFactoryImpl(),
  featureIds: features,
  featureNames: featureNames,
  encodedHeaderPostfix: headerPostfix,
  encodedHeaderPrefix: headerPrefix,
  unknownValueHandlingType: unknownValueHandlingType,
);