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 Summary
Modifier and TypeFieldDescriptionstatic final int
Protobuf serialization version.Fields inherited from interface org.tribuo.protos.ProtoSerializable
DESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER
-
Constructor Summary
ConstructorDescriptionBinningTransformer
(BinningTransformation.BinningType type, double[] bins, double[] values) Constructs a binning transformer with the supplied bin widths and bin values. -
Method Summary
-
Field Details
-
CURRENT_VERSION
public static final int CURRENT_VERSIONProtobuf serialization version.- See Also:
-
-
Constructor Details
-
BinningTransformer
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 interfaceTransformer
- Parameters:
input
- The value to transform.- Returns:
- The transformed value.
-
toString
-
equals
-
hashCode
public int hashCode() -
serialize
public org.tribuo.protos.core.TransformerProto serialize()Description copied from interface:ProtoSerializable
Serializes this object to a protobuf.- Specified by:
serialize
in interfaceProtoSerializable<org.tribuo.protos.core.TransformerProto>
- Returns:
- The protobuf.
-