Class CategoricalIDInfo
java.lang.Object
org.tribuo.SkeletalVariableInfo
org.tribuo.CategoricalInfo
org.tribuo.CategoricalIDInfo
- All Implemented Interfaces:
- Serializable,- Cloneable,- ProtoSerializable<org.tribuo.protos.core.VariableInfoProto>,- VariableIDInfo,- VariableInfo
Same as a 
CategoricalInfo, but with an additional int id field.- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intProtobuf serialization version.Fields inherited from class org.tribuo.CategoricalInfocdf, observedCount, observedValue, THRESHOLD, totalObservations, valueCounts, valuesFields inherited from class org.tribuo.SkeletalVariableInfocount, nameFields inherited from interface org.tribuo.protos.ProtoSerializableDESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER
- 
Constructor SummaryConstructorsConstructorDescriptionCategoricalIDInfo(CategoricalInfo info, int id) Constructs a categorical id info copying the information from the supplied info, with the specified id.
- 
Method SummaryModifier and TypeMethodDescriptioncopy()Returns a copy of this variable info.static CategoricalIDInfodeserializeFromProto(int version, String className, com.google.protobuf.Any message) Deserialization factory.booleanGenerates aRealIDInfothat matches this CategoricalInfo and also contains an id number.intgetID()The id number associated with this variable.inthashCode()makeIDInfo(int id) Generates a VariableIDInfo subclass which represents the same feature.Rename generates a fresh VariableInfo with the new name.toString()Methods inherited from class org.tribuo.CategoricalInfofrequencyBasedSample, frequencyBasedSample, getObservationCount, getUniqueObservations, getValues, observe, serialize, uniformSampleMethods inherited from class org.tribuo.SkeletalVariableInfogetCount, getNameMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.tribuo.protos.ProtoSerializableserializeMethods inherited from interface org.tribuo.VariableInfogetCount, getName, uniformSample
- 
Field Details- 
CURRENT_VERSIONpublic static final int CURRENT_VERSIONProtobuf serialization version.- See Also:
 
 
- 
- 
Constructor Details- 
CategoricalIDInfoConstructs a categorical id info copying the information from the supplied info, with the specified id.- Parameters:
- info- The info to copy.
- id- The id number to use.
 
 
- 
- 
Method Details- 
deserializeFromProtopublic static CategoricalIDInfo deserializeFromProto(int version, String className, com.google.protobuf.Any message) throws com.google.protobuf.InvalidProtocolBufferException Deserialization factory.- Parameters:
- version- The serialized object version.
- className- The class name.
- message- The serialized data.
- Returns:
- The deserialized object.
- Throws:
- com.google.protobuf.InvalidProtocolBufferException- If the protobuf could not be parsed from the- message.
 
- 
getIDpublic int getID()Description copied from interface:VariableIDInfoThe id number associated with this variable.Ids are non-negative integers. - Specified by:
- getIDin interface- VariableIDInfo
- Returns:
- The id number.
 
- 
generateRealInfoGenerates aRealIDInfothat matches this CategoricalInfo and also contains an id number.- Overrides:
- generateRealInfoin class- CategoricalInfo
- Returns:
- A RealInfo representing the data in this CategoricalInfo.
 
- 
copyDescription copied from interface:VariableInfoReturns a copy of this variable info.- Specified by:
- copyin interface- VariableInfo
- Overrides:
- copyin class- CategoricalInfo
- Returns:
- A copy.
 
- 
makeIDInfoDescription copied from interface:VariableInfoGenerates a VariableIDInfo subclass which represents the same feature.- Specified by:
- makeIDInfoin interface- VariableInfo
- Overrides:
- makeIDInfoin class- CategoricalInfo
- Parameters:
- id- The id number.
- Returns:
- A VariableInfo with the same information, plus the id.
 
- 
renameDescription copied from interface:VariableInfoRename generates a fresh VariableInfo with the new name. The name forms part of the hashcode so it's immutable in the object.- Specified by:
- renamein interface- VariableInfo
- Overrides:
- renamein class- CategoricalInfo
- Parameters:
- newName- The new name.
- Returns:
- A VariableInfo subclass with the new name.
 
- 
toString- Overrides:
- toStringin class- CategoricalInfo
 
- 
equals- Overrides:
- equalsin class- CategoricalInfo
 
- 
hashCodepublic int hashCode()- Overrides:
- hashCodein class- CategoricalInfo
 
 
-