com.eharmony.aloha.models.multilabel.json

MultilabelModelReader

final case class MultilabelModelReader[U, K, A, B <: U](semantics: Semantics[A], auditor: Auditor[U, Map[K, Double], B], plugins: Map[String, MultilabelModelParserPlugin])(implicit refInfoK: RefInfo[K], jsonFormatK: JsonFormat[K], serEvK: SerializabilityEvidence[K]) extends JsonReader[MultilabelModel[U, K, A, B]] with MultilabelModelJson with EitherHelpers with RegFeatureCompiler with Product with Serializable

A JSON reader capable of turning JSON to a MultilabelModel. Created by ryan.deak on 9/7/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.

semantics

semantics used to generate features and labels of interest.

auditor

the auditor used to translate the MultilabelModel output values to B instances.

plugins

the possible plugins to which MultilabelModel can delegate to produce predictions. Plugins are responsible for creating the predictorProducer passed to the MultilabelModel constructor.

refInfoK

reflection information about the label type.

jsonFormatK

a JSON format capable of parsing the label type.

serEvK

evidence that the label type is Serializable.

Self Type
MultilabelModelReader[U, K, A, B]
Linear Supertypes
Serializable, Serializable, Product, Equals, RegFeatureCompiler, EitherHelpers, MultilabelModelJson, ScalaJsonFormats, SpecJson, JsonReader[MultilabelModel[U, K, A, B]], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MultilabelModelReader
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. RegFeatureCompiler
  7. EitherHelpers
  8. MultilabelModelJson
  9. ScalaJsonFormats
  10. SpecJson
  11. JsonReader
  12. AnyRef
  13. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MultilabelModelReader(semantics: Semantics[A], auditor: Auditor[U, Map[K, Double], B], plugins: Map[String, MultilabelModelParserPlugin])(implicit refInfoK: RefInfo[K], jsonFormatK: JsonFormat[K], serEvK: SerializabilityEvidence[K])

    semantics

    semantics used to generate features and labels of interest.

    auditor

    the auditor used to translate the MultilabelModel output values to B instances.

    plugins

    the possible plugins to which MultilabelModel can delegate to produce predictions. Plugins are responsible for creating the predictorProducer passed to the MultilabelModel constructor.

    refInfoK

    reflection information about the label type.

    jsonFormatK

    a JSON format capable of parsing the label type.

    serEvK

    evidence that the label type is Serializable.

Type Members

  1. type ENS[+A] = Either[Seq[String], A]

    Either of Non-empty Seq (Like poor man's version of ValidationNel from scalaz)

    Either of Non-empty Seq (Like poor man's version of ValidationNel from scalaz)

    Attributes
    protected[this]
    Definition Classes
    EitherHelpers
  2. case class MultilabelData[K](modelType: String, modelId: ModelId, features: ListMap[String, Spec], numMissingThreshold: Option[Int], labelsInTrainingSet: Vector[K], labelsOfInterest: Option[String], underlying: JsObject) extends PluginInfo[K] with Product with Serializable

    AST for multi-label models.

  3. case class Plugin(type: String) extends Product with Serializable

    Attributes
    protected[this]
    Definition Classes
    MultilabelModelJson

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. implicit object FeatureSpecFormat extends JsonFormat[Spec]

    Attributes
    protected[this]
    Definition Classes
    SpecJson
  7. final def asInstanceOf[T0]: T0

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

    the auditor used to translate the MultilabelModel output values to B instances.

  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def features[A](featureMap: Seq[(String, Spec)], semantics: Semantics[A]): ENS[Seq[(String, GenAggFunc[A, Iterable[(String, Double)]])]]

    Translate the feature specification into features.

    Translate the feature specification into features. This is done in a short circuiting way so that it stops when the any feature cannot be produced.

    A

    model input type

    featureMap

    a map of feature name to feature specification

    semantics

    a semantics with which feature specifications should be interpretted.

    returns

    a mapping from feature name to feature function. Note that the indices matter and that's why we don't want to use a map.

    Attributes
    protected[this]
    Definition Classes
    RegFeatureCompiler
  12. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. def fromValidationNel[A](v: ValidationNel[String, A]): ENS[A]

    Attributes
    protected[this]
    Definition Classes
    EitherHelpers
  14. final def getClass(): Class[_]

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

    Definition Classes
    Any
  16. implicit def listMapFormat[K, V](implicit arg0: JsonFormat[K], arg1: JsonFormat[V]): RootJsonFormat[ListMap[K, V]] { def write(m: scala.collection.immutable.ListMap[K,V]): spray.json.JsObject }

    Definition Classes
    ScalaJsonFormats
  17. def mapSeq[A, B](l: Seq[A])(f: (A) ⇒ ENS[B]): ENS[Seq[B]]

    Like l.

    Like l.map(f).sequence[({type L[+A] = Either[Seq[String], A]})#L, C ] in scalaz except that it short circuits if it finds an error. (There must be some better way to do this w/ scalaz).

    If we put a println("folding") at the top of the inner function h, we would get the following:

    scala> mapSeq(Left(Seq("1")) +: (2 to 3).map(Right(_)))(identity)  // Only 1 "folding" instead of 3.
    folding
    res0: ENS[Seq[Int]] = Left(List(0))
    
    scala> mapSeq((1 to 3).map(Right(_)))(identity)
    folding
    folding
    folding
    res1: ENS[Seq[Int]] = Right(List(1, 2, 3))
    A

    type of values in the input sequence in the first parameter list.

    B

    type of values in the output sequence if successful.

    l

    list of values to which f should be applied.

    f

    function to map over l

    returns

    Attributes
    protected[this]
    Definition Classes
    EitherHelpers
  18. implicit final def multilabelDataJsonFormat[K](implicit arg0: JsonFormat[K]): RootJsonFormat[MultilabelData[K]]

    Attributes
    protected[this]
    Definition Classes
    MultilabelModelJson
  19. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  22. implicit final val pluginJsonFormat: RootJsonFormat[Plugin]

    Attributes
    protected[this]
    Definition Classes
    MultilabelModelJson
  23. val plugins: Map[String, MultilabelModelParserPlugin]

    the possible plugins to which MultilabelModel can delegate to produce predictions.

    the possible plugins to which MultilabelModel can delegate to produce predictions. Plugins are responsible for creating the predictorProducer passed to the MultilabelModel constructor.

  24. def read(json: JsValue): MultilabelModel[U, K, A, B]

    Definition Classes
    MultilabelModelReader → JsonReader
  25. val semantics: Semantics[A]

    semantics used to generate features and labels of interest.

  26. final val specJsonFormat: RootJsonFormat[Spec]

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

    Definition Classes
    AnyRef
  28. def toValidationNel[A](e: ENS[A]): ValidationNel[String, A]

    Attributes
    protected[this]
    Definition Classes
    EitherHelpers
  29. final def wait(): Unit

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. 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 RegFeatureCompiler

Inherited from EitherHelpers

Inherited from MultilabelModelJson

Inherited from ScalaJsonFormats

Inherited from SpecJson

Inherited from JsonReader[MultilabelModel[U, K, A, B]]

Inherited from AnyRef

Inherited from Any

Ungrouped