Class/Object

com.eharmony.aloha.models.multilabel

MultilabelModel

Related Docs: object MultilabelModel | package multilabel

Permalink

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: SparsePredictorProducer[K], 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
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: SparsePredictorProducer[K], numMissingThreshold: Option[Int], auditor: Auditor[U, Map[K, Double], B])(implicit ev: SerializabilityEvidence[K])

    Permalink

    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]] = scm.Map.empty, missingOk: Boolean = true) extends Product with Serializable

    Permalink

    Container for information returned by RegressionFeatures.constructFeatures.

    Container for information returned by RegressionFeatures.constructFeatures. Note that as is, this declaration will cause a compiler warning:

    "The outer reference in this type test cannot be checked at run time."

    This is a known issue and is a scala bug. See: - https://issues.scala-lang.org/browse/SI-4440 - http://stackoverflow.com/questions/16450008/typesafe-swing-events-the-outer-reference-in-this-type-test-cannot-be-checked-a

    A solution that would remove the warning is to make the class not final. Not doing this just to remove a warning.

    features

    features that were extracted from an input value.

    missing

    map from feature name to variables in the feature function that were missing.

    missingOk

    whether the number of

    Attributes
    protected[this]
    Definition Classes
    RegressionFeatures

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. def andThen[A](g: (B) ⇒ A): (A) ⇒ A

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

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

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

    Permalink

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

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

    Definition Classes
    MultilabelModelSubmodelBase
  8. def clone(): AnyRef

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

    Permalink

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

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

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

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

    Permalink

    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
  12. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink

    feature extracting functions.

    feature extracting functions.

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

    Permalink

    feature names (parallel to featureFunctions)

    feature names (parallel to featureFunctions)

    Definition Classes
    MultilabelModelRegressionFeatures
  16. def finalize(): Unit

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

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

    Permalink
    Definition Classes
    Any
  19. val labelsInTrainingSet: IndexedSeq[K]

    Permalink

    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.

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

    Permalink

    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.

  21. val modelId: ModelIdentity

    Permalink

    An identifier for the model.

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

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

    Permalink
    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. val numMissingThreshold: Option[Int]

    Permalink

    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
  26. val predictorProducer: SparsePredictorProducer[K]

    Permalink

    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.

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

    Permalink
    Definition Classes
    MultilabelModelSubmodel
  28. 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]]

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

    Permalink
    Definition Classes
    AnyRef
  30. def toString(): String

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

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

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

    Permalink
    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