Multiblock Bi-Projector Classifier
classifier.multiblock_biprojector.RdConstructs a k-Nearest Neighbors (k-NN) classifier based on a fitted
multiblock_biprojector model object. The classifier uses the projected scores
as the feature space for k-NN.
Usage
# S3 method for class 'multiblock_biprojector'
classifier(
x,
colind = NULL,
labels,
new_data = NULL,
block = NULL,
global_scores = TRUE,
knn = 1,
...
)Arguments
- x
A fitted
multiblock_biprojectorobject.- colind
An optional numeric vector specifying column indices from the original data space. If provided when
global_scores=FALSE, these indices are used to perform a partial projection for the reference scores. If provided whenglobal_scores=TRUE, this value is stored but does not affect the reference scores (which remain global); however, it may influence the default projection behavior during prediction unless overridden there. Seepredict.classifier.- labels
A factor or vector of class labels for the training data.
- new_data
An optional data matrix used to generate reference scores when
global_scores=FALSE, or whenglobal_scores=TRUEbutcolindorblockis also provided (overridingglobal_scores). Must be provided ifglobal_scores=FALSE.- block
An optional integer specifying a predefined block index. Used for partial projection if
global_scores=FALSEor ifnew_datais also provided. Cannot be used simultaneously withcolind.- global_scores
Logical. DEPRECATED This argument is deprecated and its behavior has changed. Reference scores are now determined automatically:
If
new_datais NULL: Uses the globally projected scores stored inx(scores(x)).If
new_datais provided: Always projectsnew_datato generate reference scores (usingpartial_project/project_blockifcolind/blockare given,projectotherwise).
- knn
The integer number of nearest neighbors (k) for the k-NN algorithm (default: 1).
- ...
Additional arguments (currently ignored).
Details
Users can specify whether to use the globally projected scores stored within the model
(global_scores = TRUE) or to generate reference scores by projecting provided new_data
(global_scores = FALSE). Partial projections based on colind or block can be used
when global_scores = FALSE or when new_data is provided alongside colind/block.
Prediction behavior is further controlled by arguments passed to predict.classifier.
See also
Other classifier:
classifier.projector(),
rf_classifier.projector()