SVMClassifier#

  • Domain: ai.onnx.ml

  • Since version: 1

Support Vector Machine classifier

Inputs

  • X (T1): Data to be classified.

Outputs

  • Y (T2): Classification outputs (one class per example).

  • Z (tensor(float)): Class scores (one per class per example), if prob_a and prob_b are provided they are probabilities for each class, otherwise they are raw scores.

Attributes

  • classlabels_ints (int[]): Class labels if using integer labels. One and only one of the ‘classlabels*’ attributes must be defined.

  • classlabels_strings (string[]): Class labels if using string labels. One and only one of the ‘classlabels*’ attributes must be defined.

  • coefficients (float[]): Dual coefficients of the support vector in the decision function.

  • kernel_params (float[]): List of 3 elements containing gamma, coef0, and degree, in that order. Zero if unused for the kernel.

  • kernel_type (string): The kernel type, one of ‘LINEAR,’ ‘POLY,’ ‘RBF,’ ‘SIGMOID’.

  • post_transform (string): Indicates the transform to apply to the score.

  • prob_a (float[]): First set of probability coefficients.

  • prob_b (float[]): Second set of probability coefficients. This array must be same size as prob_a.

  • rho (float[]): Intercept bias terms for the decision function.

  • support_vectors (float[]): Chosen support vectors (all classes concatenated).

  • vectors_per_class (int[]): Number of support vectors per class.

Type Constraints

  • T1: The input must be a tensor of a numeric type, either [C] or [N,C]. Allowed types: tensor(double), tensor(float), tensor(int32), tensor(int64).

  • T2: The output type will be a tensor of strings or integers, depending on which of the classlabels* attributes is used. Its size will match the batch size of the input. Allowed types: tensor(int64), tensor(string).

Examples#

test_cc_svmclassifier_int64_binary

Node:
  ai.onnx.ml.SVMClassifier(x) -> (y, z)
  Attributes:
    kernel_type = "LINEAR"
    kernel_params = [0.0, 0.0, 0.0]
    vectors_per_class = [1, 1]
    support_vectors = [1.0, 0.0, 0.0, 1.0]
    coefficients = [1.0, -1.0]
    rho = [0.0]
    post_transform = "NONE"
    classlabels_ints = [0, 1]
Inputs:
  x: shape=(2, 2), dtype=float32
    [[2., 1.],
     [0., 3.]]

Outputs:
  y: shape=(2,), dtype=int64
    [0, 1]
  z: shape=(2, 2), dtype=float32
    [[-1.,  1.],
     [ 3., -3.]]