LabVIEW Analytics and Machine Learning Toolkit API Reference

Set Classification Model VI

  • Updated2023-02-21
  • 8 minute(s) read

Set Classification Model VI

Owning Palette: Classification VIs

Requires: Analytics and Machine Learning Toolkit

Sets properties for a trained classification model before deployment.

SVM

model in specifies the information about the entire workflow of the model.
SVM model specifies the information about the trained SVM model.

The following equation defines the SVM model decision function:



where
sgn is the sign function
l is the number of support vectors
yi is the label of the support vector
αi is the coefficient of the support vector
xi is the support vector
x is the input data
K(xi, x) is the kernel function of xi and x. Available kernel function types include linear, polynomial, radial basis, and sigmoid.
ρ is the decision function constant
kernel settings specifies settings to configure the kernel function.

This VI supports the following kernel functions:

Kernel functionDefinitionDescription
Linear functionx and y are the input sample vectors.
Polynomial functionx and y are the input sample vectors; gamma, coef0, and degree are the algorithm coefficients.
Radial basis functionx and y are the input sample vectors.
Sigmoid functionx and y are the input sample vectors; gamma and coef0 are the algorithm coefficients.
type specifies the type of the kernel function.

0Linear—Linear function
1Polynomial—Polynomial function
2RBF—Radial basis function
3Sigmoid—Sigmoid function
degree specifies the degree coefficient of the kernel function.
gamma specifies the gamma coefficient of the kernel function.
coef0 specifies the coef0 coefficient of the kernel function.
number of classes specifies the number of classes.
label of each class specifies the label of each class.
number of support vectors specifies the number of support vectors.
support vectors specifies the support vectors. The number of rows must equal the number of support vectors and the number of columns must equal the number of features.
coefficients of support vectors specifies the coefficients of support vectors. The format of coefficients of support vectors is <number of classes - 1, number of support vectors>.
decision function constants specifies the decision function constants.
pairwise probability specifies the estimated probabilities of the classes in the trained SVM model.
probA specifies the estimated probability of a specific class in the trained SVM model.
probB specifies the estimated probability of a specific class in the trained SVM model.
number of support vectors for each class specifies the number of support vectors for each class.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
model out returns the information about the entire workflow of the model. Wire model out to the reference input of a standard Property Node to get an AML Analytics Property Node.
error out contains error information. This output provides standard error out functionality.

Neural Network

model in specifies the information about the entire workflow of the model.
neural network model specifies the information about the trained neural network model.

This VI supports single hidden layers only.
number of classes specifies the number of classes.
label of each class specifies the label of each class.
number of input neurons specifies the number of neurons in the input layer.
number of hidden neurons specifies the number of neurons in the hidden layer.
number of output neurons specifies the number of neurons in the output layer.
hidden layer type specifies the activation function type in the neurons of the hidden layer.

This VI supports the following activation functions for the hidden layer:

Function typeDefinitionDescription
Sigmoid functionx is the activation value of the hidden neuron.
Tanh functionx is the activation value of the hidden neuron.
Rectified linear unit functionx is the activation value of the hidden neuron.


0Sigmoid (default)—Sigmoid function
1Tanh—Tanh function
2ReLU—Rectified linear unit function
output layer type specifies the activation function type in the neurons of the output layer.

This VI supports the following activation functions for the output layer:

Function typeDefinitionDescription
Sigmoid functionx is the activation value of the output neuron.
Softmax functionx is the activation value of the output neuron and n is the number of classes.


0Sigmoid (default)—Sigmoid function
1Softmax—Softmax function
I to H coefficients specifies the trained coefficients between the input layer and the hidden layer.
H to O coefficients specifies the trained coefficients between the hidden layer and the output layer.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
model out returns the information about the entire workflow of the model. Wire model out to the reference input of a standard Property Node to get an AML Analytics Property Node.
error out contains error information. This output provides standard error out functionality.

Logistic Regression

model in specifies the information about the entire workflow of the model.
logistic regression model specifies the information about the trained logistic regression model.

The following equation defines the logistic regression model:



where
x is the input with k + 1 dimensions. x0 is always 1.
y is the output with a binary value 0 or 1
β is the weight vector with k + 1 dimensions. Specify the value of β by using coefficients
P (y = 1|x) is the probability of y = 1 given a known instance of x
number of classes specifies the number of classes.
label of each class specifies the label of each class.
coefficients specifies the trained coefficients of the trained logistic regression model.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
model out returns the information about the entire workflow of the model. Wire model out to the reference input of a standard Property Node to get an AML Analytics Property Node.
error out contains error information. This output provides standard error out functionality.