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 TypeFieldDescriptionDistance metric to use.Parallel backend to use.Parallel backend to use.int
K nearest neighbours to use.int
Number of threads to use.The nearest neighbour implementation factory 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. -
distType
Distance metric to use. Defaults to L2 (EUCLIDEAN). -
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. -
nqFactoryType
@Option(longName="knn-neighbour-query-factory-type", usage="The nearest neighbour implementation factory to use.") public NeighboursQueryFactoryType nqFactoryTypeThe nearest neighbour implementation factory to use. Defaults toNeighboursQueryFactoryType.BRUTE_FORCE
.
-
-
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.
-