Package org.tribuo.common.nearest
Class KNNClassifierOptions
java.lang.Object
org.tribuo.common.nearest.KNNClassifierOptions
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Options
,ClassificationOptions<KNNTrainer<Label>>
public class KNNClassifierOptions
extends Object
implements ClassificationOptions<KNNTrainer<Label>>
CLI Options for training a k-nearest neighbour predictor.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The type of combination function. -
Field Summary
Modifier and TypeFieldDescriptionParallel backend to use.Distance metric to use.Parallel backend to use.int
K nearest neighbours to use.int
Number of threads to use.Fields inherited from interface com.oracle.labs.mlrg.olcut.config.Options
header
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionConstructs the trainer based on the provided arguments.
-
Field Details
-
knnK
@Option(longName="knn-k", usage="K nearest neighbours to use.") public int knnKK nearest neighbours to use. Defaults to 1. -
knnNumThreads
@Option(longName="knn-num-threads", usage="Number of threads to use.") public int knnNumThreadsNumber of threads to use. Defaults to 1. -
knnDistance
@Option(longName="knn-distance", usage="Distance metric to use.") public KNNTrainer.Distance knnDistanceDistance metric to use. Defaults to L2. -
knnBackend
@Option(longName="knn-backend", usage="Parallel backend to use.") public KNNModel.Backend knnBackendParallel backend to use. -
knnEnsembleCombiner
@Option(longName="knn-voting", usage="Parallel backend to use.") public KNNClassifierOptions.EnsembleCombinerType knnEnsembleCombinerParallel backend to use.
-
-
Constructor Details
-
KNNClassifierOptions
public KNNClassifierOptions()
-
-
Method Details
-
getOptionsDescription
- Specified by:
getOptionsDescription
in interfacecom.oracle.labs.mlrg.olcut.config.Options
-
getTrainer
Description copied from interface:ClassificationOptions
Constructs the trainer based on the provided arguments.- Specified by:
getTrainer
in interfaceClassificationOptions<KNNTrainer<Label>>
- Returns:
- The trainer.
-