run.knn.classifier: run.knn.classifier - Run KNN classifier

Description Usage Arguments Value Author(s) References

View source: R/run.knn.classifier.R

Description

run.knn.classifier - Run KNN classifier

Usage

1
run.knn.classifier(train.dat, unlabelled.dat, use.cols, label.col, num.neighbours)

Arguments

train.dat

NO DEFAULT. data.frame. A dataframe containing cells (rows) vs features/markers (columns) to be used to train classifier.

unlabelled.dat

NO DEFAULT. data.frame. A dataframe containing cells (rows) vs features/markers (columns) that is the data classified.

use.cols

NO DEFAULT. Vector of column names to use for training k-nearest neighbour (KNN) classifier.

label.col

NO DEFAULT. Character. Name of the column representing the population name of the cells in dat.

num.neighbours

DEFAULTS to 1. Numeric. When using a k-nearest neighbour classifier, then this parameter specifies the number of nearest neighbours.

Train a k-NN classifier on a training data, and use it to classify an unlabelled data. Note that for the classifier to work as intended, the unlabelled.data has to be normalised to the range of the train.data. Note make sure that train.data and unlabelled.data has exactly the same features/markers.

Value

The predicted label for the unlabelled data.

Author(s)

Givanna Putri, ghar1821@uni.sydney.edu.au

References

https://sydneycytometry.org.au/spectre.


sydneycytometry/Spectre documentation built on March 20, 2021, 2:15 a.m.