LinearClassifier#
Domain:
ai.onnx.mlSince version: 1
Linear classifier
Inputs
X (T1): Data to be classified.
Outputs
Y (T2): Classification outputs (one class per example).
Z (tensor(float)): Classification scores ([N,E] - one score for each class and example
Type Constraints
T1: The input must be a tensor of a numeric type, and of shape [N,C] or [C]. In the latter case, it will be treated as [1,C] Allowed types: tensor(double), tensor(float), tensor(int32), tensor(int64).
T2: The output will be a tensor of strings or integers. Allowed types: tensor(int64), tensor(string).
Examples#
test_cc_linearclassifier_int64_binary
Node:
ai.onnx.ml.LinearClassifier(x) -> (y, z)
Attributes:
coefficients = [1.0, -1.0]
intercepts = [0.0]
multi_class = 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
[1, 0]
z: shape=(2, 2), dtype=float32
[[-1., 1.],
[ 3., -3.]]