Uses of Class
org.tribuo.classification.Label
Packages that use Label
Package
Description
Provides classes and infrastructure for multiclass classification problems.
Provides simple baseline multiclass classifiers.
Provides majority vote ensemble combiners for classification
along with an implementation of multiclass Adaboost.
Evaluation classes for multi-class classification.
Provides a multiclass data generator used for testing implementations, along with several synthetic data generators
for 2d binary classification problems to be used in demos or tutorials.
Provides infrastructure for
SequenceModels which
emit Labels at each step of the sequence.Provides a classification sequence data generator for smoke testing implementations.
Provides an implementation of Viterbi for generating structured outputs, which can sit on top of any
Label based classification model.-
Uses of Label in org.tribuo.classification
Classes in org.tribuo.classification with type parameters of type LabelModifier and TypeInterfaceDescriptioninterfaceClassificationOptions<TRAINER extends Trainer<Label>>AnOptionsthat can produce a classificationTrainerbased on the provided arguments.Fields in org.tribuo.classification declared as LabelModifier and TypeFieldDescriptionstatic final LabelLabelFactory.UNKNOWN_LABELThe singleton unknown label, used for unlablled examples.Fields in org.tribuo.classification with type parameters of type LabelMethods in org.tribuo.classification that return LabelModifier and TypeMethodDescriptionLabel.copy()<V> LabelLabelFactory.generateOutput(V label) Generates the Label string by calling toString on the input.ImmutableLabelInfo.getOutput(int id) LabelFactory.getUnknownOutput()Methods in org.tribuo.classification that return types with arguments of type LabelModifier and TypeMethodDescriptionLabelFactory.constructInfoForExternalModel(Map<Label, Integer> mapping) LabelInfo.generateImmutableOutputInfo()LabelFactory.generateInfo()Generates an empty MutableLabelInfo.LabelInfo.generateMutableOutputInfo()ImmutableLabelInfo.getDomain()Returns the set of possibleLabels that this LabelInfo has seen.LabelInfo.getDomain()Returns the set of possibleLabels that this LabelInfo has seen.LabelFactory.getEvaluator()ImmutableLabelInfo.iterator()TrainTestHelper.run(com.oracle.labs.mlrg.olcut.config.ConfigurationManager cm, org.tribuo.data.DataOptions dataOptions, Trainer<Label> trainer) This method trains a model on the specified training data, and evaluates it on the specified test data.Methods in org.tribuo.classification with parameters of type LabelModifier and TypeMethodDescriptionbooleanLabel.fullEquals(Label o) intlongLabelInfo.getLabelCount(Label label) Gets the count of the supplied label, or 0 if the label is unknown.voidMethod parameters in org.tribuo.classification with type arguments of type LabelModifier and TypeMethodDescriptionLabelFactory.constructInfoForExternalModel(Map<Label, Integer> mapping) booleanImmutableLabelInfo.domainAndIDEquals(ImmutableOutputInfo<Label> other) TrainTestHelper.run(com.oracle.labs.mlrg.olcut.config.ConfigurationManager cm, org.tribuo.data.DataOptions dataOptions, Trainer<Label> trainer) This method trains a model on the specified training data, and evaluates it on the specified test data.voidWeightedLabels.setLabelWeights(Map<Label, Float> map) Sets the label weights used by this trainer. -
Uses of Label in org.tribuo.classification.baseline
Methods in org.tribuo.classification.baseline that return types with arguments of type LabelModifier and TypeMethodDescriptionDummyClassifierTrainer.train(Dataset<Label> examples, Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> instanceProvenance) DummyClassifierTrainer.train(Dataset<Label> examples, Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> instanceProvenance, int invocationCount) Method parameters in org.tribuo.classification.baseline with type arguments of type LabelModifier and TypeMethodDescriptionDummyClassifierTrainer.train(Dataset<Label> examples, Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> instanceProvenance) DummyClassifierTrainer.train(Dataset<Label> examples, Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> instanceProvenance, int invocationCount) -
Uses of Label in org.tribuo.classification.ensemble
Fields in org.tribuo.classification.ensemble with type parameters of type LabelMethods in org.tribuo.classification.ensemble that return types with arguments of type LabelModifier and TypeMethodDescriptionFullyWeightedVotingCombiner.combine(ImmutableOutputInfo<Label> outputInfo, List<Prediction<Label>> predictions) FullyWeightedVotingCombiner.combine(ImmutableOutputInfo<Label> outputInfo, List<Prediction<Label>> predictions, float[] weights) VotingCombiner.combine(ImmutableOutputInfo<Label> outputInfo, List<Prediction<Label>> predictions) VotingCombiner.combine(ImmutableOutputInfo<Label> outputInfo, List<Prediction<Label>> predictions, float[] weights) AdaBoostTrainer.train(Dataset<Label> examples, Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> runProvenance) If the trainer implementsWeightedExamplesthen do boosting by weighting, otherwise do boosting by sampling.AdaBoostTrainer.train(Dataset<Label> examples, Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> runProvenance, int invocationCount) ClassificationEnsembleOptions.wrapTrainer(Trainer<Label> trainer) Wraps the supplied trainer using the ensemble trainer described by these options.Method parameters in org.tribuo.classification.ensemble with type arguments of type LabelModifier and TypeMethodDescriptionFullyWeightedVotingCombiner.combine(ImmutableOutputInfo<Label> outputInfo, List<Prediction<Label>> predictions) FullyWeightedVotingCombiner.combine(ImmutableOutputInfo<Label> outputInfo, List<Prediction<Label>> predictions) FullyWeightedVotingCombiner.combine(ImmutableOutputInfo<Label> outputInfo, List<Prediction<Label>> predictions, float[] weights) FullyWeightedVotingCombiner.combine(ImmutableOutputInfo<Label> outputInfo, List<Prediction<Label>> predictions, float[] weights) VotingCombiner.combine(ImmutableOutputInfo<Label> outputInfo, List<Prediction<Label>> predictions) VotingCombiner.combine(ImmutableOutputInfo<Label> outputInfo, List<Prediction<Label>> predictions) VotingCombiner.combine(ImmutableOutputInfo<Label> outputInfo, List<Prediction<Label>> predictions, float[] weights) VotingCombiner.combine(ImmutableOutputInfo<Label> outputInfo, List<Prediction<Label>> predictions, float[] weights) AdaBoostTrainer.train(Dataset<Label> examples, Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> runProvenance) If the trainer implementsWeightedExamplesthen do boosting by weighting, otherwise do boosting by sampling.AdaBoostTrainer.train(Dataset<Label> examples, Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> runProvenance, int invocationCount) ClassificationEnsembleOptions.wrapTrainer(Trainer<Label> trainer) Wraps the supplied trainer using the ensemble trainer described by these options.Constructor parameters in org.tribuo.classification.ensemble with type arguments of type LabelModifierConstructorDescriptionAdaBoostTrainer(Trainer<Label> trainer, int numMembers) Constructs an adaboost trainer using the supplied weak learner trainer and the specified number of boosting rounds.AdaBoostTrainer(Trainer<Label> trainer, int numMembers, long seed) Constructs an adaboost trainer using the supplied weak learner trainer, the specified number of boosting rounds and the supplied seed. -
Uses of Label in org.tribuo.classification.evaluation
Methods in org.tribuo.classification.evaluation that return types with arguments of type LabelModifier and TypeMethodDescriptionLabelMetric.Context.getCM()Gets the confusion matrix.LabelConfusionMatrix.getDomain()LabelMetrics.getImpl()Returns the implementing function for this metric.LabelConfusionMatrix.getLabelOrder()Gets the current label order.LabelMetric.getTarget()LabelConfusionMatrix.observed()Methods in org.tribuo.classification.evaluation with parameters of type LabelModifier and TypeMethodDescriptiondoubleThe per label accuracy of the evaluation.doubleArea under the ROC curve.static doubleLabelMetrics.AUCROC(Label label, List<Prediction<Label>> predictions) Area under the ROC curve.doubleLabelEvaluation.averagedPrecision(Label label) Summarises a Precision-Recall Curve by taking the weighted mean of the precisions at a given threshold, where the weight is the recall achieved at that threshold.static doubleLabelMetrics.averagedPrecision(Label label, List<Prediction<Label>> predictions) doubledoubledoubleLabelEvaluation.precisionRecallCurve(Label label) Calculates the Precision Recall curve for a single label.static LabelEvaluationUtil.PRCurveLabelMetrics.precisionRecallCurve(Label label, List<Prediction<Label>> predictions) doubledoubledoubleMethod parameters in org.tribuo.classification.evaluation with type arguments of type LabelModifier and TypeMethodDescriptionstatic doubleLabelMetrics.AUCROC(Label label, List<Prediction<Label>> predictions) Area under the ROC curve.static doubleLabelMetrics.AUCROC(MetricTarget<Label> tgt, List<Prediction<Label>> predictions) Area under the ROC curve.static doubleLabelMetrics.AUCROC(MetricTarget<Label> tgt, List<Prediction<Label>> predictions) Area under the ROC curve.static doubleLabelMetrics.averagedPrecision(Label label, List<Prediction<Label>> predictions) static doubleLabelMetrics.averagedPrecision(MetricTarget<Label> tgt, List<Prediction<Label>> predictions) static doubleLabelMetrics.averagedPrecision(MetricTarget<Label> tgt, List<Prediction<Label>> predictions) protected LabelMetric.ContextLabelEvaluator.createContext(Model<Label> model, List<Prediction<Label>> predictions) protected LabelMetric.ContextLabelEvaluator.createContext(Model<Label> model, List<Prediction<Label>> predictions) LabelMetric.createContext(Model<Label> model, List<Prediction<Label>> predictions) LabelMetric.createContext(Model<Label> model, List<Prediction<Label>> predictions) protected LabelEvaluationLabelEvaluator.createEvaluation(LabelMetric.Context ctx, Map<MetricID<Label>, Double> results, EvaluationProvenance provenance) protected Set<LabelMetric>LabelEvaluator.createMetrics(Model<Label> model) LabelMetrics.forTarget(MetricTarget<Label> tgt) Gets the LabelMetric wrapped around the supplied MetricTarget.static LabelEvaluationUtil.PRCurveLabelMetrics.precisionRecallCurve(Label label, List<Prediction<Label>> predictions) voidLabelConfusionMatrix.setLabelOrder(List<Label> newLabelOrder) Sets the label order used inLabelConfusionMatrix.toString().Constructor parameters in org.tribuo.classification.evaluation with type arguments of type LabelModifierConstructorDescriptionConstructs a context and compute the confusion matrix using the specified model and predictions.Constructs a context and compute the confusion matrix using the specified model and predictions.Context(SequenceModel<Label> model, List<Prediction<Label>> predictions) Constructs a context and compute the confusion matrix using the specified model and predictions.Context(SequenceModel<Label> model, List<Prediction<Label>> predictions) Constructs a context and compute the confusion matrix using the specified model and predictions.LabelConfusionMatrix(ImmutableOutputInfo<Label> domain, List<Prediction<Label>> predictions) Creates a confusion matrix from the supplied predictions and label info.LabelConfusionMatrix(ImmutableOutputInfo<Label> domain, List<Prediction<Label>> predictions) Creates a confusion matrix from the supplied predictions and label info.LabelConfusionMatrix(Model<Label> model, List<Prediction<Label>> predictions) Creates a confusion matrix from the supplied predictions, using the label info from the supplied model.LabelConfusionMatrix(Model<Label> model, List<Prediction<Label>> predictions) Creates a confusion matrix from the supplied predictions, using the label info from the supplied model.LabelMetric(MetricTarget<Label> tgt, String name, ToDoubleBiFunction<MetricTarget<Label>, LabelMetric.Context> impl) Construct a newLabelMetricfor the supplied metric target, using the supplied function.LabelMetric(MetricTarget<Label> tgt, String name, ToDoubleBiFunction<MetricTarget<Label>, LabelMetric.Context> impl) Construct a newLabelMetricfor the supplied metric target, using the supplied function. -
Uses of Label in org.tribuo.classification.example
Fields in org.tribuo.classification.example declared as LabelModifier and TypeFieldDescriptionstatic final LabelDemoLabelDataSource.FIRST_CLASSThe first class.static final LabelDemoLabelDataSource.SECOND_CLASSThe second class.Fields in org.tribuo.classification.example with type parameters of type LabelMethods in org.tribuo.classification.example that return types with arguments of type LabelModifier and TypeMethodDescriptionLabelledDataGenerator.binarySparseTrainTest()Generates a pair of datasets with sparse features and unknown features in the test data.LabelledDataGenerator.binarySparseTrainTest()Generates a pair of datasets with sparse features and unknown features in the test data.LabelledDataGenerator.binarySparseTrainTest(double negate) Generates a pair of datasets with sparse features and unknown features in the test data.LabelledDataGenerator.binarySparseTrainTest(double negate) Generates a pair of datasets with sparse features and unknown features in the test data.LabelledDataGenerator.denseTrainTest()Generates a train/test dataset pair which is dense in the features, each example has 4 features,{A,B,C,D}, and there are 4 classes, {Foo,Bar,Baz,Quux}.LabelledDataGenerator.denseTrainTest()Generates a train/test dataset pair which is dense in the features, each example has 4 features,{A,B,C,D}, and there are 4 classes, {Foo,Bar,Baz,Quux}.LabelledDataGenerator.denseTrainTest(double negate) Generates a train/test dataset pair which is dense in the features, each example has 4 features,{A,B,C,D}, and there are 4 classes, {Foo,Bar,Baz,Quux}.LabelledDataGenerator.denseTrainTest(double negate) Generates a train/test dataset pair which is dense in the features, each example has 4 features,{A,B,C,D}, and there are 4 classes, {Foo,Bar,Baz,Quux}.LabelledDataGenerator.emptyExample()Generates an example with no features.CheckerboardDataSource.generate()ConcentricCirclesDataSource.generate()DemoLabelDataSource.generate()Generates the examples using the configured fields.GaussianLabelDataSource.generate()InterlockingCrescentsDataSource.generate()NoisyInterlockingCrescentsDataSource.generate()LabelledDataGenerator.invalidSparseExample()Generates an example with the feature ids 1,5,8, which does not intersect with the ids used elsewhere in this class.DemoLabelDataSource.iterator()LabelledDataGenerator.sparseTrainTest()Generates a pair of datasets, where the features are sparse, and unknown features appear in the test data.LabelledDataGenerator.sparseTrainTest()Generates a pair of datasets, where the features are sparse, and unknown features appear in the test data.LabelledDataGenerator.sparseTrainTest(double negate) Generates a pair of datasets, where the features are sparse, and unknown features appear in the test data.LabelledDataGenerator.sparseTrainTest(double negate) Generates a pair of datasets, where the features are sparse, and unknown features appear in the test data. -
Uses of Label in org.tribuo.classification.sequence
Fields in org.tribuo.classification.sequence with type parameters of type LabelModifier and TypeFieldDescriptionSeqTrainTest.SeqTrainTestOptions.trainerName of the trainer in the configuration file.Methods in org.tribuo.classification.sequence that return types with arguments of type LabelModifier and TypeMethodDescriptionLabelSequenceEvaluation.asMap()LabelSequenceEvaluation.getConfusionMatrix()Gets the confusion matrix backing this evaluation.LabelSequenceEvaluation.getPredictions()Gets the flattened predictions.Methods in org.tribuo.classification.sequence with parameters of type LabelModifier and TypeMethodDescriptiondoubleGets the accuracy for this label.doubleNote: confusion is not stored in the underlying map, so it won't show up in aggregation.doubleThe F1 for this label.doubleThe false negative count for this label.doubleThe false positive count for this label.doubleThe precision for this label.doubleThe recall for this label.doubleThe true negative count for this label.doubleGets the true positive count for that label.Method parameters in org.tribuo.classification.sequence with type arguments of type LabelModifier and TypeMethodDescriptionprotected LabelMetric.ContextLabelSequenceEvaluator.createContext(SequenceModel<Label> model, List<List<Prediction<Label>>> predictions) protected LabelMetric.ContextLabelSequenceEvaluator.createContext(SequenceModel<Label> model, List<List<Prediction<Label>>> predictions) protected LabelSequenceEvaluationLabelSequenceEvaluator.createEvaluation(LabelMetric.Context ctx, Map<MetricID<Label>, Double> results, EvaluationProvenance provenance) protected Set<LabelMetric>LabelSequenceEvaluator.createMetrics(SequenceModel<Label> model) static <SUB extends ConfidencePredictingSequenceModel.Subsequence>
List<Double>ConfidencePredictingSequenceModel.multiplyWeights(List<Prediction<Label>> predictions, List<SUB> subsequences) A scoring method which multiplies together the per prediction scores.abstract <SUB extends ConfidencePredictingSequenceModel.Subsequence>
List<Double>ConfidencePredictingSequenceModel.scoreSubsequences(SequenceExample<Label> example, List<Prediction<Label>> predictions, List<SUB> subsequences) The scoring function for the subsequences.abstract <SUB extends ConfidencePredictingSequenceModel.Subsequence>
List<Double>ConfidencePredictingSequenceModel.scoreSubsequences(SequenceExample<Label> example, List<Prediction<Label>> predictions, List<SUB> subsequences) The scoring function for the subsequences.Constructor parameters in org.tribuo.classification.sequence with type arguments of type LabelModifierConstructorDescriptionprotectedConfidencePredictingSequenceModel(String name, ModelProvenance description, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<Label> labelIDMap) Constructs a ConfidencePredictingSequenceModel with the supplied parameters.protectedLabelSequenceEvaluation(Map<MetricID<Label>, Double> results, LabelMetric.Context ctx, EvaluationProvenance provenance) Constructs a LabelSequenceEvaluation using the supplied parameters. -
Uses of Label in org.tribuo.classification.sequence.example
Methods in org.tribuo.classification.sequence.example that return types with arguments of type LabelModifier and TypeMethodDescriptionstatic SequenceExample<Label>SequenceDataGenerator.generateEmptyExample()This generates a sequence example with no examples.static SequenceExample<Label>SequenceDataGenerator.generateGorillaA()Generates a sequence example with a mixture of features and three labels "O", "Status" and "Monkey".static SequenceExample<Label>SequenceDataGenerator.generateGorillaB()Generates a sequence example with a mixture of features and three labels "O", "Status" and "Monkey".static MutableSequenceDataset<Label>SequenceDataGenerator.generateGorillaDataset(int numCopies) Generates a simple dataset consisting of numCopies repeats of two sequences.static SequenceExample<Label>SequenceDataGenerator.generateInvalidExample()This generates a sequence example with features that are unused by the training data.static SequenceExample<Label>SequenceDataGenerator.generateOtherInvalidExample()This generates a sequence example where the first example has no features. -
Uses of Label in org.tribuo.classification.sequence.viterbi
Methods in org.tribuo.classification.sequence.viterbi that return types with arguments of type LabelModifier and TypeMethodDescriptionViterbiModel.getTopLabels(Map<String, Label> distribution) ViterbiModel.getTopLabels(Map<String, Label> distribution, int stackSize) List<List<Prediction<Label>>>ViterbiModel.predict(SequenceDataset<Label> examples) ViterbiModel.predict(SequenceExample<Label> examples) ViterbiTrainer.train(SequenceDataset<Label> dataset, Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> runProvenance) The viterbi train method is unique because it delegates to a regularModeltrain method, but before it does, it adds features derived from preceding labels.Method parameters in org.tribuo.classification.sequence.viterbi with type arguments of type LabelModifier and TypeMethodDescriptionDefaultFeatureExtractor.extractFeatures(List<Label> previousOutcomes, double value) LabelFeatureExtractor.extractFeatures(List<Label> previousOutcomes, double value) Generates features based on the previously produced labels.NoopFeatureExtractor.extractFeatures(List<Label> previousOutcomes, double value) ViterbiTrainerOptions.getSequenceTrainer(Trainer<Label> innerTrainer) Creates a viterbi trainer wrapping the supplied label trainer.ViterbiModel.getTopLabels(Map<String, Label> distribution) ViterbiModel.getTopLabels(Map<String, Label> distribution, int stackSize) List<List<Prediction<Label>>>ViterbiModel.predict(SequenceDataset<Label> examples) ViterbiModel.predict(SequenceExample<Label> examples) ViterbiTrainer.train(SequenceDataset<Label> dataset, Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> runProvenance) The viterbi train method is unique because it delegates to a regularModeltrain method, but before it does, it adds features derived from preceding labels.Constructor parameters in org.tribuo.classification.sequence.viterbi with type arguments of type LabelModifierConstructorDescriptionViterbiTrainer(Trainer<Label> trainer, LabelFeatureExtractor labelFeatureExtractor, int stackSize, ViterbiModel.ScoreAggregation scoreAggregation) Constructs a ViterbiTrainer wrapping the specified trainer.ViterbiTrainer(Trainer<Label> trainer, LabelFeatureExtractor labelFeatureExtractor, ViterbiModel.ScoreAggregation scoreAggregation) Constructs a ViterbiTrainer wrapping the specified trainer, with an unbounded stack size.