F_VN_FeatureScaling

F_VN_FeatureScaling 1:

Apply a feature scaling to one or more sample(s).

Syntax

Definition:

FUNCTION F_VN_FeatureScaling : HRESULT
VAR_INPUT
    ipSamples       : ITcVnContainer;
    ipScales        : ITcVnContainer;
    ipScaledSamples : Reference To ITcVnContainer;
    hrPrev          : HRESULT;
END_VAR

F_VN_FeatureScaling 2: Inputs

Name

Type

Description

ipSamples

ITcVnContainer

Container holding one or more input sample(s) (ContainerType_Vector_REAL, ContainerType_Vector_LREAL, ContainerType_Vector_Vector_REAL, or ContainerType_Vector_Vector_LREAL)

ipScales

ITcVnContainer

Container with the scaling parameters of each feature (type ContainerType_Vector_REAL or ContainerType_Vector_LREAL).

ipScaledSamples

Reference To ITcVnContainer

Returns the scaled sample(s) using the same type like ipSamples. If the same container ipSamples is uesd, the source data will be replaced.

hrPrev

HRESULT

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

F_VN_FeatureScaling 3: Return value

HRESULT

Further information

The function F_VN_FeatureScaling scales features from several samples. The function F_VN_InverseFeatureScaling can be used for inverse scaling.

Parameter

Samples

One or more samples must be transferred as a container to ipSamples.

Scaling

A container with the scaling type and the corresponding scaling parameters must be transferred to ipScales. The container can be calculated using the function F_VN_GetFeatureScales or created using the structure described there.

Scaled samples

The scaled samples are returned via the reference ipScaledSamples.

Expert parameters

The expert variant F_VN_FeatureScalingExp contains additional parameters.

Application

For example, a feature scaling in which the scaling parameters are calculated beforehand by F_VN_GetFeatureScales using the MINMAX method looks like this:

hr := F_VN_GetFeatureScales(ipSamples, ipScales, TCVN_FST_MINMAX, hr);

hr := F_VN_FeatureScaling(
    ipSamples       := ipSamples,
    ipScales        := ipScales,
    ipScaledSamples := ipScaledSamples,
    hrPrev          := hr);

Related functions

Required License

TC3 Vision Machine Learning

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4024.54 or later

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

Tc3_Vision