Class RealIDInfo
java.lang.Object
org.tribuo.SkeletalVariableInfo
org.tribuo.RealInfo
org.tribuo.RealIDInfo
- All Implemented Interfaces:
Serializable,Cloneable,ProtoSerializable<org.tribuo.protos.core.VariableInfoProto>,VariableIDInfo,VariableInfo
Same as a
RealInfo, but with an additional int id field.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intProtobuf serialization version.Fields inherited from class org.tribuo.RealInfo
max, mean, min, sumSquaresFields inherited from class org.tribuo.SkeletalVariableInfo
count, nameFields inherited from interface org.tribuo.protos.ProtoSerializable
DESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER -
Constructor Summary
ConstructorsConstructorDescriptionRealIDInfo(String name, int count, double max, double min, double mean, double sumSquares, int id) Constructs a real id info from the supplied arguments.RealIDInfo(RealInfo info, int id) Constructs a deep copy of the supplied real info and id. -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a copy of this variable info.static RealIDInfodeserializeFromProto(int version, String className, com.google.protobuf.Any message) Deserialization factory.booleanintgetID()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.RealInfo
getMax, getMean, getMin, getVariance, observe, serialize, uniformSampleMethods inherited from class org.tribuo.SkeletalVariableInfo
getCount, getNameMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.tribuo.protos.ProtoSerializable
serializeMethods inherited from interface org.tribuo.VariableInfo
getCount, getName, uniformSample
-
Field Details
-
CURRENT_VERSION
public static final int CURRENT_VERSIONProtobuf serialization version.- See Also:
-
-
Constructor Details
-
RealIDInfo
public RealIDInfo(String name, int count, double max, double min, double mean, double sumSquares, int id) Constructs a real id info from the supplied arguments.- Parameters:
name- The feature name.count- The feature occurrence count.max- The maximum observed value.min- The minimum observed value.mean- The observed mean.sumSquares- The observed sum of squared values.id- The id number.
-
RealIDInfo
Constructs a deep copy of the supplied real info and id.- Parameters:
info- The info to copy.id- The new id number.
-
-
Method Details
-
deserializeFromProto
public static RealIDInfo 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 themessage.
-
getID
public int 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.
-
makeIDInfo
Description copied from interface:VariableInfoGenerates a VariableIDInfo subclass which represents the same feature.- Specified by:
makeIDInfoin interfaceVariableInfo- Overrides:
makeIDInfoin classRealInfo- 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 classRealInfo- Parameters:
newName- The new name.- Returns:
- A VariableInfo subclass with the new name.
-
copy
Description copied from interface:VariableInfoReturns a copy of this variable info.- Specified by:
copyin interfaceVariableInfo- Overrides:
copyin classRealInfo- Returns:
- A copy.
-
toString
-
equals
-
hashCode
-