LabVIEW Analytics and Machine Learning Toolkit API Reference

Initialize Anomaly Detection Model (SOM-MQE) VI

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

Initialize Anomaly Detection Model (SOM-MQE) VI

Owning Palette: Anomaly Detection VIs

Requires: Analytics and Machine Learning Toolkit

Initializes the hyperparameters of the self-organizing map (SOM) algorithm.

The minimum quantization error (MQE) is the distance between the input data and the best matching unit.

The Deploy Anomaly Detection Model VI uses health index to return the MQE value.

You can initialize a SOM model for batch training with this VI when you have a large training data set. To improve the machine learning model quality and the predictive performance, NI recommends that you shuffle the data set before training so each batch has similar distribution.

Examples

One Shot

initial parameters specifies the initial parameters of the SOM baseline model.
map structure settings specifies settings to configure the map structure.
auto set? specifies whether this VI automatically configures the map structure. The default is TRUE, which specifies that this VI automatically configures the map structure.
map structure specifies settings for the map structure. This input is valid only if auto set? is FALSE.
row specifies the number of rows of the SOM baseline model. The default is 7.
column specifies the number of columns of the SOM baseline model. The default is 7.
lattice type specifies the lattice type of the SOM baseline model.

0rectangular (default)
1hexagonal


The following figure shows the rectangular lattice:



The following figure shows the hexagonal lattice:

initial map vectors specifies the initial map vectors. The number of columns is the number of features. The number of rows is the area of map structure and equals row * column. This input is valid only if auto set? is FALSE.
  • If this input is empty, this VI randomly generates the initial map vectors.
  • If the number of rows of initial map vectors is greater than row * column, this VI deletes extra rows from initial map vectors.
  • If the number of rows of initial map vectors is less than row * column, this VI adds new rows with randomly generated elements to initial map vectors so that the number of rows of initial map vectors equals row * column.
hyperparameters specifies the hyperparameters of the SOM baseline model.
initial radius specifies the initial radius for finding the neighbor neurons. The default is 3.
initial learning rate specifies the initial learning rate for training the map vectors. The default is 0.1.
max iteration specifies the maximum number of optimization iterations for the stopping criteria. The default is 20. The model fitting stops if the number of optimization iterations reaches max iteration.
confidence level specifies the confidence level for calculating the suggested threshold. The default is 0.95.

For example, if confidence value is 0.95, this VI calculates the suggested threshold that allows 5 percent of the training samples to have health index exceeding the threshold and regarded as anomalies. You can access the suggested threshold using the AML SOM-MQE Property Node.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
untrained SOM baseline model returns the initialized SOM baseline model for training.
error out contains error information. This output provides standard error out functionality.

Batch

initial parameters specifies the initial parameters of the SOM baseline model.
map structure specifies settings for the map structure.
row specifies the number of rows of the SOM baseline model. The default is 15.
column specifies the number of columns of the SOM baseline model. The default is 10.
lattice type specifies the lattice type of the SOM baseline model.

0rectangular (default)
1hexagonal


The following figure shows the rectangular lattice:



The following figure shows the hexagonal lattice:

initial map vectors specifies the initial map vectors. The number of columns is the number of features. The number of rows is the area of map structure and equals row * column. This input is valid only if auto set? is FALSE.
  • If this input is empty, this VI randomly generates the initial map vectors.
  • If the number of rows of initial map vectors is greater than row * column, this VI deletes extra rows from initial map vectors.
  • If the number of rows of initial map vectors is less than row * column, this VI adds new rows with randomly generated elements to initial map vectors so that the number of rows of initial map vectors equals row * column.
hyperparameters specifies the hyperparameters of the SOM baseline model.
initial radius specifies the initial radius for finding the neighbor neurons. The default is 3.
initial learning rate specifies the initial learning rate for training the map vectors. The default is 0.1.
max iteration specifies the maximum number of optimization iterations for the stopping criteria. The default is 20. The model fitting stops if the number of optimization iterations reaches max iteration.
confidence level specifies the confidence level for calculating the suggested threshold. The default is 0.95.

For example, if confidence value is 0.95, this VI calculates the suggested threshold that allows 5 percent of the training samples to have health index exceeding the threshold and regarded as anomalies. You can access the suggested threshold using the AML SOM-MQE Property Node.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
untrained SOM baseline model returns the initialized SOM baseline model for training.
error out contains error information. This output provides standard error out functionality.

Examples

Refer to the following VIs for examples of using the Initialize Anomaly Detection Model (SOM-MQE) VI:

  • Anomaly Detection (Training) VI: labview\examples\AML\Anomaly Detection
  • Anomaly Detection (Training) (Batch) VI: labview\examples\AML\Anomaly Detection