Class

com.eharmony.aloha.models.multilabel.json

MultilabelModelReader

Related Doc: package json

Permalink

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
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])

    Permalink

    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]

    Permalink

    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

    Permalink

    AST for multi-label models.

    AST for multi-label models.

    labelsInTrainingSet

    The sequence of all labels encountered in training. It is important that this is sequence (with the same order as the labels in the training set). This is because some algorithms may require indices based on the training data.

    labelsOfInterest

    a string representing a function that will be used to extract labels.

    underlying

    the underlying model that will be produced by a

    Attributes
    protected[this]
    Definition Classes
    MultilabelModelJson
  3. case class Plugin(type: String) extends Product with Serializable

    Permalink
    Attributes
    protected[this]
    Definition Classes
    MultilabelModelJson

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

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

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

    Permalink

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

  7. def clone(): AnyRef

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

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

    Permalink

    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
  10. def finalize(): Unit

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

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

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

    Permalink
    Definition Classes
    Any
  14. 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 }

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

    Permalink

    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.

    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

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

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

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

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

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

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

    Permalink

    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.

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

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

    Permalink

    semantics used to generate features and labels of interest.

  24. final val specJsonFormat: RootJsonFormat[Spec]

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

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

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

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

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