Class CategoricalIDInfo
java.lang.Object
org.tribuo.SkeletalVariableInfo
org.tribuo.CategoricalInfo
org.tribuo.CategoricalIDInfo
- All Implemented Interfaces:
Serializable,Cloneable,VariableIDInfo,VariableInfo
Same as a
CategoricalInfo, but with an additional int id field.- See Also:
-
Field Summary
Fields inherited from class org.tribuo.CategoricalInfo
cdf, observedCount, observedValue, THRESHOLD, totalObservations, valueCounts, valuesFields inherited from class org.tribuo.SkeletalVariableInfo
count, name -
Constructor Summary
ConstructorsConstructorDescriptionCategoricalIDInfo(CategoricalInfo info, int id) Constructs a categorical id info copying the information from the supplied info, with the specified id. -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a copy of this variable info.Generates aRealIDInfothat matches this CategoricalInfo and also contains an id number.intgetID()The id number associated with this variable.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.CategoricalInfo
frequencyBasedSample, frequencyBasedSample, getObservationCount, getUniqueObservations, observe, uniformSampleMethods inherited from class org.tribuo.SkeletalVariableInfo
equals, getCount, getName, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.tribuo.VariableInfo
getCount, getName, uniformSample
-
Constructor Details
-
CategoricalIDInfo
Constructs 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
-
getID
Description copied from interface:VariableIDInfoThe id number associated with this variable.Ids are non-negative integers.
- Specified by:
getIDin interfaceVariableIDInfo- Returns:
- The id number.
-
generateRealInfo
Generates aRealIDInfothat matches this CategoricalInfo and also contains an id number.- Overrides:
generateRealInfoin classCategoricalInfo- Returns:
- A RealInfo representing the data in this CategoricalInfo.
-
copy
Description copied from interface:VariableInfoReturns a copy of this variable info.- Specified by:
copyin interfaceVariableInfo- Overrides:
copyin classCategoricalInfo- Returns:
- A copy.
-
makeIDInfo
Description copied from interface:VariableInfoGenerates a VariableIDInfo subclass which represents the same feature.- Specified by:
makeIDInfoin interfaceVariableInfo- Overrides:
makeIDInfoin classCategoricalInfo- Parameters:
id- The id number.- Returns:
- A VariableInfo with the same information, plus the id.
-
rename
Description 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 interfaceVariableInfo- Overrides:
renamein classCategoricalInfo- Parameters:
newName- The new name.- Returns:
- A VariableInfo subclass with the new name.
-
toString
- Overrides:
toStringin classCategoricalInfo
-