Class BinningTransformation.BinningTransformer

java.lang.Object
org.tribuo.transform.transformations.BinningTransformation.BinningTransformer
All Implemented Interfaces:
Serializable, ProtoSerializable<org.tribuo.protos.core.TransformerProto>, Transformer
Enclosing class:
BinningTransformation

public static final class BinningTransformation.BinningTransformer extends Object implements Transformer
The implementation of a Transformer which splits the input into n bins.
See Also:
  • Field Details

    • CURRENT_VERSION

      public static final int CURRENT_VERSION
      Protobuf serialization version.
      See Also:
  • Constructor Details

    • BinningTransformer

      public BinningTransformer(BinningTransformation.BinningType type, double[] bins, double[] values)
      Constructs a binning transformer with the supplied bin widths and bin values.
      Parameters:
      type - The type of the generated bins.
      bins - The bin start/end points.
      values - The values for each bin.
  • Method Details

    • transform

      public double transform(double input)
      Description copied from interface: Transformer
      Applies the transformation to the supplied input value.
      Specified by:
      transform in interface Transformer
      Parameters:
      input - The value to transform.
      Returns:
      The transformed value.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • serialize

      public org.tribuo.protos.core.TransformerProto serialize()
      Description copied from interface: ProtoSerializable
      Serializes this object to a protobuf.
      Specified by:
      serialize in interface ProtoSerializable<org.tribuo.protos.core.TransformerProto>
      Returns:
      The protobuf.