CreateKnnModel

Create a k-nearest neighbors model of the specified type. The initial reference count is set to one if a new model is created and kept, otherwise. Models of this type support on-line training (sample by sample) and retraining. Predictions can only be scalar.

Syntax

Definition:

HRESULT CreateKnnModel(
    HRESULT        hrPrev,
    ITcVnMlModel*& ipMlModel,
    ETcVnKnn       eKnnType,
    ULONG          nK
)

Parameters

Name

Type

Description

hrPrev

HRESULT

HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.)

ipMlModel

ITcVnMlModel*&

Returns the created model (Non-zero interface pointers are reused.)

eKnnType

ETcVnKnn

k-nearest neighbors model type

nK

ULONG

Parameter k used for prediction (number of considered neighbors)

CreateKnnModel 1: Return value

HRESULT

Required License

TC3 Vision Machine Learning

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1. 4024.44 or later

PC or CX (x64) with PL50, e.g. Intel 4-core Atom CPU

Tc3_Vision