Back to bricks list
Introduction Getting Started
ID Card
Technical Documentation
Tasks
AdaBoost classifier predictor AdaBoost classifier trainer AdaBoost regression predictor AdaBoost regression trainer Agglomerative clustering trainer Base supervised predictor Base supervised trainer Base unsupervised predictor Base unsupervised trainer BNB classifier predictor BNB classifier trainer Decision tree classifier predictor Decision tree classifier trainer Decision tree regressor predictor Decision tree regressor trainer Elastic-Net predictor ElasticNet trainer Extra-Trees classifier predictor Extra-Trees classifier trainer Extra-Trees regressor predictor Extra-Trees regressor trainer Gaussian mixture trainer Gaussian process classifier predictor Gaussian process classifier trainer Gaussian process regressor predictor Gaussian process regressor trainer GNB classifier trainer GNB predictor Gradient-Boosting classifier predictor Gradient-Boosting classifier trainer Gradient-Boosting regressor predictor Gradient-Boosting regressor trainer ICA trainer Kernel-Ridge predictor Kernel-Ridge trainer KMeans predictor KMeans trainer KNN classifier predictor KNN classifier trainer KNN regressor predictor KNN regressor trainer Lasso predictor Lasso trainer LDA predictor LDA trainer Linear regression predictor Linear regression trainer LLE trainer LMETrainer Logistic regression predictor Logistic regression trainer MNB classifier predictor MNB trainer PCA trainer PCoA trainer PLS regression predictor PLS regression trainer PLSDA predictor PLSDA trainer QDA predictor QDA trainer Random-Forest classifier predictor Random-Forest classifier trainer Random-Forest regression predictor Random-Forest regressor trainer Ridge classifier predictor Ridge classifier trainer Ridge regression predictor Ridge regression trainer SGD classifier predictor SGD classifier trainer SGD regressor predictor SGD regressor trainer SVC predictor SVC trainer SVC trainer SVR predictor
Version

KNN classifier trainer

TASK
Typing name :  TASK.gws_gaia.KNNClassifierTrainer Brick :  gws_gaia

Train a k-nearest neighbors classifier model

Trainer of a k-nearest neighbors classifier. Fit the k-nearest neighbors classifier from the training table.

See https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KNeighborsClassifier.html for more details.

Input

Table
The input table

Output

result
The output result

Configuration

training_design

Define the training design, i.e. the target Y to use for the model.

Type : ListMaximum occurrences number : -1

target_name

The name of the 'columns' or 'row_tag keys' to use as targets or labels.

Type : string

target_origin

Optional

The origin of the target. Notice: Targets comming from a 'row_tag' are always considered as categorical.

Type : stringDefault value : column

target_type

Optional

The type of the target (categorical or numerical). Set 'auto' to infer the correct type. Notice: targets comming from row_tags are allways considered as categorical

Type : stringDefault value : auto

nb_neighbors

Optional

Type : intDefault value : 5