Package de.jungblut.classification.tree
Enum FeatureType
- java.lang.Object
-
- java.lang.Enum<FeatureType>
-
- de.jungblut.classification.tree.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 inDecisionTree.- Author:
- thomasjungblut
-
-
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.booleanisNominal()booleanisNumerical()static FeatureTypevalueOf(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.
-
-
-
Enum Constant Detail
-
NOMINAL
public static final FeatureType NOMINAL
-
NUMERICAL
public static final FeatureType NUMERICAL
-
-
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 namejava.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.
-
-