Interface VariableInfo
- All Superinterfaces:
Cloneable
,ProtoSerializable<org.tribuo.protos.core.VariableInfoProto>
,Serializable
- All Known Subinterfaces:
VariableIDInfo
- All Known Implementing Classes:
CategoricalIDInfo
,CategoricalInfo
,RealIDInfo
,RealInfo
,SkeletalVariableInfo
public interface VariableInfo
extends Serializable, ProtoSerializable<org.tribuo.protos.core.VariableInfoProto>, Cloneable
A VariableInfo subclass contains information about a feature and
its observed values.
-
Field Summary
Fields inherited from interface org.tribuo.protos.ProtoSerializable
DESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
Returns a copy of this variable info.static VariableInfo
deserialize
(org.tribuo.protos.core.VariableInfoProto proto) Deserializes the variable info from the supplied protobuf.int
getCount()
The occurrence count of this feature.getName()
The name of this feature.makeIDInfo
(int id) Generates a VariableIDInfo subclass which represents the same feature.Rename generates a fresh VariableInfo with the new name.double
Sample a value uniformly from the range of this variable.Methods inherited from interface org.tribuo.protos.ProtoSerializable
serialize
-
Method Details
-
getName
-
getCount
int getCount()The occurrence count of this feature.- Returns:
- The occurrence count.
-
makeIDInfo
Generates a VariableIDInfo subclass which represents the same feature.- Parameters:
id
- The id number.- Returns:
- A VariableInfo with the same information, plus the id.
-
rename
Rename generates a fresh VariableInfo with the new name. The name forms part of the hashcode so it's immutable in the object.- Parameters:
name
- The new name.- Returns:
- A VariableInfo subclass with the new name.
-
uniformSample
Sample a value uniformly from the range of this variable.- Parameters:
rng
- The rng to use.- Returns:
- A sample from this variable.
-
copy
-
deserialize
Deserializes the variable info from the supplied protobuf.- Parameters:
proto
- The protobuf to deserialize.- Returns:
- The variable info.
-