A multi-label predictor.
A multi-label predictor.
Created by ryan.deak on 8/29/17.
upper bound on model output type B
type of label or class
input type of the model
output type of the model.
An identifier for the model. Used in score and error reporting.
feature names (parallel to featureFunctions)
feature extracting functions.
a sequence of all labels encountered during training. Note: the order of labels may relate to the predictor produced by predictorProducer. It is the caller's responsibility to ensure the order is correct. To mitigate such problems, both labels and indices into labelsInTrainingSet are passed to the predictor produced by predictorProducer.
if provided, a sequence of labels will be extracted from the example for which a prediction is desired. The intersection of the extracted labels and the training labels will be the labels for which predictions will be produced.
the function produced when calling this function is responsible for getting the data into the correct type and using it within an underlying ML library to produce a prediction. The mapping back to (K, Double) pairs is also its responsibility. If the predictor produced by predictorProducer is Closeable, it will be closed when MultilabelModel's close method is called.
if provided, we check whether the threshold is exceeded. If so, return an error instead of the computed score. This is for missing data situations.
transforms a Map[K, Double]
to a B
. Reports successes and errors.
evidence that K
is serializable.
A plugin that will ultimately produce the SparseMultiLabelPredictor.
A plugin that will ultimately produce the SparseMultiLabelPredictor. Created by ryan.deak on 9/6/17.
Created by ryan.deak on 9/6/17.
Created by ryan.deak on 9/7/17.
A sparse multi-label predictor takes:
A sparse multi-label predictor takes:
and returns a Map from the labels passed in, to the prediction associated with the label.
A lazy version of a sparse multi-label predictor.
A lazy version of a sparse multi-label predictor. It is a curried zero-arg function that produces a sparse multi-label predictor.
This definition is "lazy" because we can't guarantee that the underlying predictor is
Serializable
so we pass around a function that can be cached in a transient
lazy val
. This function should however be Serializable
and testing should be done
to ensure that each predictor producer is Serializable
.
Created by ryan.deak on 8/31/17.