com.eharmony.aloha.models.multilabel

MultilabelModel

case class MultilabelModel[U, K, -A, +B <: U](modelId: ModelIdentity, featureNames: IndexedSeq[String], featureFunctions: IndexedSeq[GenAggFunc[A, Sparse]], labelsInTrainingSet: IndexedSeq[K], labelsOfInterest: Option[GenAggFunc[A, IndexedSeq[K]]], predictorProducer: () ⇒ (SparseFeatures, Labels[K], LabelIndices, SparseLabelDepFeatures) ⇒ Try[Map[K, Double]], numMissingThreshold: Option[Int], auditor: Auditor[U, Map[K, Double], B])(implicit ev: SerializabilityEvidence[K]) extends SubmodelBase[U, Map[K, Double], A, B] with RegressionFeatures[A] with Product with Serializable

A multi-label predictor.

Created by ryan.deak on 8/29/17.

U

upper bound on model output type B

K

type of label or class

A

input type of the model

B

output type of the model.

modelId

An identifier for the model. Used in score and error reporting.

featureNames

feature names (parallel to featureFunctions)

featureFunctions

feature extracting functions.

labelsInTrainingSet

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.

labelsOfInterest

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.

predictorProducer

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.

numMissingThreshold

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.

auditor

transforms a Map[K, Double] to a B. Reports successes and errors.

ev

evidence that K is serializable.

Linear Supertypes
Serializable, Serializable, Product, Equals, RegressionFeatures[A], SubmodelBase[U, Map[K, Double], A, B], Model[A, B], (A) ⇒ B, Submodel[Map[K, Double], A, B], Closeable, AutoCloseable, Identifiable[ModelIdentity], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MultilabelModel
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. RegressionFeatures
  7. SubmodelBase
  8. Model
  9. Function1
  10. Submodel
  11. Closeable
  12. AutoCloseable
  13. Identifiable
  14. AnyRef
  15. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MultilabelModel(modelId: ModelIdentity, featureNames: IndexedSeq[String], featureFunctions: IndexedSeq[GenAggFunc[A, Sparse]], labelsInTrainingSet: IndexedSeq[K], labelsOfInterest: Option[GenAggFunc[A, IndexedSeq[K]]], predictorProducer: () ⇒ (SparseFeatures, Labels[K], LabelIndices, SparseLabelDepFeatures) ⇒ Try[Map[K, Double]], numMissingThreshold: Option[Int], auditor: Auditor[U, Map[K, Double], B])(implicit ev: SerializabilityEvidence[K])

    modelId

    An identifier for the model. Used in score and error reporting.

    featureNames

    feature names (parallel to featureFunctions)

    featureFunctions

    feature extracting functions.

    labelsInTrainingSet

    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.

    labelsOfInterest

    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.

    predictorProducer

    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.

    numMissingThreshold

    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.

    auditor

    transforms a Map[K, Double] to a B. Reports successes and errors.

    ev

    evidence that K is serializable.

Type Members

  1. case class Features[F](features: F, missing: Map[String, Seq[String]] = ..., missingOk: Boolean = true) extends Product with Serializable

    Container for information returned by RegressionFeatures.constructFeatures.

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def andThen[A](g: (B) ⇒ A): (A) ⇒ A

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  7. final def apply(a: A): B

    Definition Classes
    SubmodelBase → Function1
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. val auditor: Auditor[U, Map[K, Double], B]

    transforms a Map[K, Double] to a B.

    transforms a Map[K, Double] to a B. Reports successes and errors.

    Definition Classes
    MultilabelModelSubmodelBase
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def close(): Unit

    When the predictor passed to the constructor is a java.

    When the predictor passed to the constructor is a java.io.Closeable, its close method is called.

    Definition Classes
    MultilabelModelSubmodelBase → Closeable → AutoCloseable
  12. def compose[A](g: (A) ⇒ A): (A) ⇒ B

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  13. final def constructFeatures(a: A): Features[IndexedSeq[Sparse]]

    Extract the features from the raw data by mapping featureFunctions over the input.

    Extract the features from the raw data by mapping featureFunctions over the input. If numMissingThreshold is not None and the number of resulting empty Iterables exceeds the numMissingThreshold value, then the resulting Features.missingOk value is false; otherwise, it will be true. If Features.missingOk is false, then go back and check all feature functions for missing values and add findings to the Features.missing map. This Features.missing is a mapping from the feature specification to the list of variable names whose associated values are missing from the input.

    a

    raw input data of the model input type.

    returns

    a Features instance with the following: 1 the transformed input vector 1 the map of bad features to the missing values in the raw data that were needed to compute the feature 1 whether the amount of missing data is acceptable to still continue

    Attributes
    protected[this]
    Definition Classes
    RegressionFeatures
  14. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. def failure(errorMsgs: ⇒ Seq[String] = Nil, missingVarNames: ⇒ Set[String] = Set.empty, subvalues: Seq[U] = Nil): Subvalue[B, Map[K, Double]]

    Attributes
    protected[this]
    Definition Classes
    SubmodelBase
  16. val featureFunctions: IndexedSeq[GenAggFunc[A, Sparse]]

    feature extracting functions.

    feature extracting functions.

    Definition Classes
    MultilabelModelRegressionFeatures
  17. val featureNames: IndexedSeq[String]

    feature names (parallel to featureFunctions)

    feature names (parallel to featureFunctions)

    Definition Classes
    MultilabelModelRegressionFeatures
  18. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  21. val labelsInTrainingSet: IndexedSeq[K]

    a sequence of all labels encountered during training.

    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.

  22. val labelsOfInterest: Option[GenAggFunc[A, IndexedSeq[K]]]

    if provided, a sequence of labels will be extracted from the example for which a prediction is desired.

    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.

  23. val modelId: ModelIdentity

    An identifier for the model.

    An identifier for the model. Used in score and error reporting.

    Definition Classes
    MultilabelModelIdentifiable
  24. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  27. val numMissingThreshold: Option[Int]

    if provided, we check whether the threshold is exceeded.

    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.

    Definition Classes
    MultilabelModelRegressionFeatures
  28. val predictorProducer: () ⇒ (SparseFeatures, Labels[K], LabelIndices, SparseLabelDepFeatures) ⇒ Try[Map[K, Double]]

    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 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.

  29. def subvalue(a: A): Subvalue[B, Map[K, Double]]

    Definition Classes
    MultilabelModelSubmodel
  30. def success(naturalValue: Map[K, Double], errorMsgs: ⇒ Seq[String] = Nil, missingVarNames: ⇒ Set[String] = Set.empty, subvalues: Seq[U] = Nil, prob: ⇒ Option[Float] = None): Subvalue[B, Map[K, Double]]

    Attributes
    protected[this]
    Definition Classes
    SubmodelBase
  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  32. def toString(): String

    Definition Classes
    Function1 → AnyRef → Any
  33. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from RegressionFeatures[A]

Inherited from SubmodelBase[U, Map[K, Double], A, B]

Inherited from Model[A, B]

Inherited from (A) ⇒ B

Inherited from Submodel[Map[K, Double], A, B]

Inherited from Closeable

Inherited from AutoCloseable

Inherited from Identifiable[ModelIdentity]

Inherited from AnyRef

Inherited from Any

Ungrouped