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
Nested ClassesModifier and TypeClassDescriptionstatic enumThe type of combination function. -
Field Summary
FieldsModifier and TypeFieldDescriptionDistance metric to use.Parallel backend to use.Parallel backend to use.intK nearest neighbours to use.intNumber 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
Constructors -
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:
getOptionsDescriptionin interfacecom.oracle.labs.mlrg.olcut.config.Options
-
getTrainer
Description copied from interface:ClassificationOptionsConstructs the trainer based on the provided arguments.- Specified by:
getTrainerin interfaceClassificationOptions<KNNTrainer<Label>>- Returns:
- The trainer.
-