Skip to content

KNN

KNN - GetClasses

Returns the number of classes considered by the model.

IN

Name Type Description
InKNN DataModel_KNN The input KNN
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutInt Int Number of classes.
Error ErrorState Gets the execution error message

KNN - GetFeatures

Returns the number of features considered by the model.

IN

Name Type Description
InKNN DataModel_KNN The input KNN
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutInt Int Number of features.
Error ErrorState Gets the execution error message

KNN - IsTrained

Checks if model has been trained.

IN

Name Type Description
InKNN DataModel_KNN The input KNN
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutBool Bool true if model was trained, false otherwise.
Error ErrorState Gets the execution error message

KNN - Load

Load internal model.

IN

Name Type Description
InFilename PathFile Filename.
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutKNN DataModel_KNN Loaded model.
Error ErrorState Gets the execution error message

KNN - Predict_Dataset

Classify dataset's features.

IN

Name Type Description
InKNN DataModel_KNN The input KNN
InDataset Dataset Input dataset.
InK Int Number of nearest neighbors. It should be an odd value starting from 1 (3 and 5 are good values to start from).
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutInt IntArray Predicted classes.
Error ErrorState Gets the execution error message

KNN - Predict_Multiple

Classify multiple feature vectors.

IN

Name Type Description
InKNN DataModel_KNN The input KNN
InFeatures FloatArrayArray Input features.
InK Int Number of nearest neighbors. It should be an odd value starting from 1 (3 and 5 are good values to start from).
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutInt IntArray Predicted classes.
Error ErrorState Gets the execution error message

KNN - Predict_Single

Classify a feature vector.

IN

Name Type Description
InKNN DataModel_KNN The input KNN
InFeatures FloatArray Input features.
InK Int Number of nearest neighbors. It should be an odd value starting from 1 (3 and 5 are good values to start from).
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutInt Int Predicted class.
Error ErrorState Gets the execution error message

KNN - Save

Save internal model.

IN

Name Type Description
InKNN DataModel_KNN The input KNN
InFilename PathFile Filename.
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
Error ErrorState Gets the execution error message

KNN - Train_FromDataset

Train a new model.

IN

Name Type Description
InDataset Dataset Dataset.
InShuffle Bool Whether to shuffle the data.
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutKNN DataModel_KNN Trained model.
Error ErrorState Gets the execution error message

KNN - Train_FromFeaturesAndClasses

Train a new model.

IN

Name Type Description
InFeatures FloatArrayArray Features.
InClasses IntArray Corresponding classes.
InNClasses Int Number of classes.
InShuffle Bool Whether to shuffle the data.
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutKNN DataModel_KNN Trained model.
Error ErrorState Gets the execution error message