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.

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.]]