SupportVectorMachine

class SupportVectorMachine(val supportVectors: Option[SupportVectors], val coefficients: Coefficients, val targetCategory: Option[Any], val alternateTargetCategory: Option[Any], val threshold: Option[Double]) extends PmmlElement

Holds a single instance of an SVM.

SupportVectors holds the support vectors as references towards VectorDictionary used by the respective SVM instance. For storing the SVM coefficients, the element Coefficients is used. Both are combined in the element SupportVectorMachine, which holds a single instance of an SVM.

The attribute targetCategory is required for classification models and gives the corresponding class label. This attribute is to be used for classification models implementing the one-against-all method. In this method, for n classes, there are exactly n SupportVectorMachine elements. Depending on the model attribute maxWins, the SVM with the largest or the smallest value determines the predicted class label.

The attribute alternateTargetCategory is required in case of binary classification models with only one SupportVectorMachine element. It is also required in case of multi-class classification models implementing the one-against-one method. In this method, for n classes, there are exactly n(n-1)/2 SupportVectorMachine elements where each SVM is trained on data from two classes. The first class is represented by the targetCategory attribute and the second class by the alternateTargetCategory attribute. The predicted class label is determined based on a voting scheme in which the category with the maximum number of votes wins. In case of a tie, the predicted class label is the first category with maximal number of votes. For both cases (binary classification and multi-class classification with one-against-one), the corresponding class labels are determined by comparing the numeric prediction with the threshold. If maxWins is true and the prediction is larger than the threshold or maxWins is false and the prediction is smaller than the threshold, the class label is the targetCategory attribute, otherwise, it is the alternateTargetCategory attribute.

Note that each SupportVectorMachine element may have its own threshold that overrides the default.

trait Serializable
class Object
trait Matchable
class Any

Value members

Concrete methods

def eval(xs: Array[Double], kernelType: KernelType): Double
def init(vectorDictionary: VectorDictionary, svmRepresentation: SVMRepresentation): Unit
def predict(xs: Array[Double], kernelType: KernelType, maxWins: Boolean, threshold: Double, alternateTargetCategoryInferred: Option[Any]): Any

Inherited methods

Inherited from:
HasExtensions
def hasExtensions: Boolean
Inherited from:
HasExtensions

Concrete fields

val alternateTargetCategory: Option[Any]
val targetCategory: Option[Any]
val threshold: Option[Double]