Enum FeatureType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<FeatureType>

    public enum FeatureType
    extends java.lang.Enum<FeatureType>
    Denotes a feature type, either numerical or nominal. This is majorly used in DecisionTree.
    Author:
    thomasjungblut
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      NOMINAL  
      NUMERICAL  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static FeatureType[] allNominal​(int numFeatures)
      Creates an array that denotes the type of a feature at a given feature index.
      static FeatureType[] allNumerical​(int numFeatures)
      Creates an array that denotes the type of a feature at a given feature index.
      boolean isNominal()  
      boolean isNumerical()  
      static FeatureType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static FeatureType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • values

        public static FeatureType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (FeatureType c : FeatureType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static FeatureType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • isNumerical

        public boolean isNumerical()
        Returns:
        true if this is numerical.
      • isNominal

        public boolean isNominal()
        Returns:
        true if this is nominal.
      • allNominal

        public static FeatureType[] allNominal​(int numFeatures)
        Creates an array that denotes the type of a feature at a given feature index. This method sets all features to a nominal/categorical type.
        Parameters:
        numFeatures - the number of features.
        Returns:
        the array that contains the type mappings.
      • allNumerical

        public static FeatureType[] allNumerical​(int numFeatures)
        Creates an array that denotes the type of a feature at a given feature index. This method sets all features to a numeric type.
        Parameters:
        numFeatures - the number of features.
        Returns:
        the array that contains the type mappings.