Package org.tribuo

Class SkeletalVariableInfo

java.lang.Object
org.tribuo.SkeletalVariableInfo
All Implemented Interfaces:
Serializable, Cloneable, VariableInfo
Direct Known Subclasses:
CategoricalInfo, RealInfo

public abstract class SkeletalVariableInfo extends Object implements VariableInfo
Contains information about a feature and can be stored in the feature map in a Dataset.
See Also:
  • Field Details

    • name

      protected final String name
      The name of the feature.
    • count

      protected int count
      How often the feature occurs in the dataset.
  • Constructor Details

    • SkeletalVariableInfo

      protected SkeletalVariableInfo(String name)
      Constructs a variable info with the supplied name.
      Parameters:
      name - The feature name.
    • SkeletalVariableInfo

      protected SkeletalVariableInfo(String name, int count)
      Constructs a variable info with the supplied name and initial count.
      Parameters:
      name - The feature name.
      count - The initial occurrence count.
  • Method Details

    • observe

      protected void observe(double value)
      Records the value.
      Parameters:
      value - The observed value.
    • getName

      public String getName()
      Returns the name of the feature.
      Specified by:
      getName in interface VariableInfo
      Returns:
      The name of the feature.
    • getCount

      public int getCount()
      Returns the occurrence count of this feature.
      Specified by:
      getCount in interface VariableInfo
      Returns:
      The count of observed values.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object