Enum Class KernelType

java.lang.Object
java.lang.Enum<KernelType>
org.tribuo.common.libsvm.KernelType
All Implemented Interfaces:
Serializable, Comparable<KernelType>, Constable

public enum KernelType extends Enum<KernelType> implements Serializable
Kernel types from libsvm.
  • Enum Constant Details

    • LINEAR

      public static final KernelType LINEAR
      A linear kernel function (i.e., a dot product).
    • POLY

      public static final KernelType POLY
      A polynomial kernel of the form (gamma*u'*v + coef0)^degree
    • RBF

      public static final KernelType RBF
      An RBF kernel of the form exp(-gamma*|u-v|^2)
    • SIGMOID

      public static final KernelType SIGMOID
      A sigmoid kernel of the form tanh(gamma*u'*v + coef0)
  • Method Details

    • values

      public static KernelType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static KernelType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getNativeType

      public int getNativeType()
      Gets LibSVM's int id.
      Returns:
      The int id.
    • getKernelType

      public static KernelType getKernelType(int nativeType)
      Converts the LibSVM int id into the enum value.
      Parameters:
      nativeType - The LibSVM id.
      Returns:
      The corresponding enum.