com.eharmony.aloha.models.reg

RegressionModel

case class RegressionModel[U, -A, +B <: U](modelId: ModelIdentity, featureNames: IndexedSeq[String], featureFunctions: IndexedSeq[GenAggFunc[A, Iterable[(String, Double)]]], beta: PolynomialEvaluationAlgo, invLinkFunction: (Double) ⇒ Double, spline: Option[Spline], numMissingThreshold: Option[Int], auditor: Auditor[U, Double, B]) extends SubmodelBase[U, Double, A, B] with RegressionFeatures[A] with Logging with Product with Serializable

A regression model capable of doing not only linear regression but polynomial regression in general.

val regImp = "com.eharmony.aloha.models.reg.RegressionModelValueToTupleConversions._"
val compiler = ...
val plugin = ...
val imports: Seq[String] = ...
val s = CompiledSemantics(compiler, plugin, imports :+ regImp)

This is useful because these conversions allow implicit conversion function from some of the AnyVal types and Options of AnyVal types to Iterable[(String, Double)]. This is useful because specifying features in the JSON spec like:

{
...
"features": {
  "intercept": "-3",
  "income": "${user.profile.income}"
}
}

into sequences like:

val interceptFeature = Iterable(("intercept", 3.0))  // AND
val incomeFeature = Iterable(("income", [the income value converted to a double]))

For more information, see com.eharmony.aloha.models.reg.RegressionModelValueToTupleConversions.

A

model input type

B

model output type. to convert from B to com.eharmony.aloha.score.Scores.Score

modelId

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

featureNames

feature names (parallel to featureFunctions)

featureFunctions

feature extracting functions.

beta

representation of the regression model parameters.

invLinkFunction

a function applied to the inner product of the input vector and weight vector.

spline

an optional calibration spline to Obtaining calibrated probability estimates from decision trees and naive Bayesian classifiers, Zadrozny, Elkan (ICML, 2001). This is applied prior to invLinkFunction

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.

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

Instance Constructors

  1. new RegressionModel(modelId: ModelIdentity, featureNames: IndexedSeq[String], featureFunctions: IndexedSeq[GenAggFunc[A, Iterable[(String, Double)]]], beta: PolynomialEvaluationAlgo, invLinkFunction: (Double) ⇒ Double, spline: Option[Spline], numMissingThreshold: Option[Int], auditor: Auditor[U, Double, B])

    modelId

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

    featureNames

    feature names (parallel to featureFunctions)

    featureFunctions

    feature extracting functions.

    beta

    representation of the regression model parameters.

    invLinkFunction

    a function applied to the inner product of the input vector and weight vector.

    spline

    an optional calibration spline to Obtaining calibrated probability estimates from decision trees and naive Bayesian classifiers, Zadrozny, Elkan (ICML, 2001). This is applied prior to invLinkFunction

    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.

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, Double, B]

    Definition Classes
    RegressionModelSubmodelBase
  10. val beta: PolynomialEvaluationAlgo

    representation of the regression model parameters.

  11. def clone(): AnyRef

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

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

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  14. 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
  15. final def debug(msg: ⇒ Any, t: ⇒ Throwable): Unit

    Issue a debug logging message, with an exception.

    Issue a debug logging message, with an exception.

    msg

    the message object. toString() is called to convert it to a loggable string.

    t

    the exception to include with the logged message.

    Attributes
    protected[this]
    Definition Classes
    Logging
  16. final def debug(msg: ⇒ Any): Unit

    Issue a debug logging message.

    Issue a debug logging message.

    msg

    the message object. toString() is called to convert it to a loggable string.

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

    Definition Classes
    AnyRef
  18. final def error(msg: ⇒ Any, t: ⇒ Throwable): Unit

    Issue a error logging message, with an exception.

    Issue a error logging message, with an exception.

    msg

    the message object. toString() is called to convert it to a loggable string.

    t

    the exception to include with the logged message.

    Attributes
    protected[this]
    Definition Classes
    Logging
  19. final def error(msg: ⇒ Any): Unit

    Issue a error logging message.

    Issue a error logging message.

    msg

    the message object. toString() is called to convert it to a loggable string.

    Attributes
    protected[this]
    Definition Classes
    Logging
  20. def failure(errorMsgs: ⇒ Seq[String] = Nil, missingVarNames: ⇒ Set[String] = Set.empty, subvalues: Seq[U] = Nil): Subvalue[B, Double]

    Attributes
    protected[this]
    Definition Classes
    SubmodelBase
  21. val featureFunctions: IndexedSeq[GenAggFunc[A, Iterable[(String, Double)]]]

    feature extracting functions.

    feature extracting functions.

    Definition Classes
    RegressionModelRegressionFeatures
  22. val featureNames: IndexedSeq[String]

    feature names (parallel to featureFunctions)

    feature names (parallel to featureFunctions)

    Definition Classes
    RegressionModelRegressionFeatures
  23. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  25. final def info(msg: ⇒ Any, t: ⇒ Throwable): Unit

    Issue a info logging message, with an exception.

    Issue a info logging message, with an exception.

    msg

    the message object. toString() is called to convert it to a loggable string.

    t

    the exception to include with the logged message.

    Attributes
    protected[this]
    Definition Classes
    Logging
  26. final def info(msg: ⇒ Any): Unit

    Issue a info logging message.

    Issue a info logging message.

    msg

    the message object. toString() is called to convert it to a loggable string.

    Attributes
    protected[this]
    Definition Classes
    Logging
  27. val invLinkFunction: (Double) ⇒ Double

    a function applied to the inner product of the input vector and weight vector.

  28. final def isDebugEnabled: Boolean

    Determine whether debug logging is enabled.

    Determine whether debug logging is enabled.

    Attributes
    protected[this]
    Definition Classes
    Logging
  29. final def isErrorEnabled: Boolean

    Determine whether error logging is enabled.

    Determine whether error logging is enabled.

    Attributes
    protected[this]
    Definition Classes
    Logging
  30. final def isInfoEnabled: Boolean

    Determine whether info logging is enabled.

    Determine whether info logging is enabled.

    Attributes
    protected[this]
    Definition Classes
    Logging
  31. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  32. final def isTraceEnabled: Boolean

    Determine whether trace logging is enabled.

    Determine whether trace logging is enabled.

    Attributes
    protected[this]
    Definition Classes
    Logging
  33. final def isWarnEnabled: Boolean

    Determine whether warn logging is enabled.

    Determine whether warn logging is enabled.

    Attributes
    protected[this]
    Definition Classes
    Logging
  34. final lazy val logger: Logger

    The logger is a @transient lazy val to enable proper working with Spark.

    The logger is a @transient lazy val to enable proper working with Spark. The logger will not be serialized with the rest of the class with which this trait is mixed-in.

    Attributes
    protected[this]
    Definition Classes
    Logging
  35. def loggerInitName(): String

    The name with which the logger is initialized.

    The name with which the logger is initialized. This can be overridden in a derived class.

    returns

    Attributes
    protected
    Definition Classes
    Logging
  36. final def loggerName: String

    Get the name associated with this logger.

    Get the name associated with this logger.

    returns

    the name.

    Attributes
    protected[this]
    Definition Classes
    Logging
  37. val modelId: ModelIdentity

    An identifier for the model.

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

    Definition Classes
    RegressionModelIdentifiable
  38. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  41. 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
    RegressionModelRegressionFeatures
  42. val spline: Option[Spline]

    an optional calibration spline to Obtaining calibrated probability estimates from decision trees and naive Bayesian classifiers, Zadrozny, Elkan (ICML, 2001).

    an optional calibration spline to Obtaining calibrated probability estimates from decision trees and naive Bayesian classifiers, Zadrozny, Elkan (ICML, 2001). This is applied prior to invLinkFunction

  43. def subvalue(a: A): Subvalue[B, Double]

    Get the score.

    Get the score.

    a

    the model input value.

    returns

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

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

    Definition Classes
    AnyRef
  46. def toString(): String

    Definition Classes
    Function1 → AnyRef → Any
  47. final def trace(msg: ⇒ Any, t: ⇒ Throwable): Unit

    Issue a trace logging message, with an exception.

    Issue a trace logging message, with an exception.

    msg

    the message object. toString() is called to convert it to a loggable string.

    t

    the exception to include with the logged message.

    Attributes
    protected[this]
    Definition Classes
    Logging
  48. final def trace(msg: ⇒ Any): Unit

    Issue a trace logging message.

    Issue a trace logging message.

    msg

    the message object. toString() is called to convert it to a loggable string.

    Attributes
    protected[this]
    Definition Classes
    Logging
  49. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  52. final def warn(msg: ⇒ Any, t: ⇒ Throwable): Unit

    Issue a warn logging message, with an exception.

    Issue a warn logging message, with an exception.

    msg

    the message object. toString() is called to convert it to a loggable string.

    t

    the exception to include with the logged message.

    Attributes
    protected[this]
    Definition Classes
    Logging
  53. final def warn(msg: ⇒ Any): Unit

    Issue a warn logging message.

    Issue a warn logging message.

    msg

    the message object. toString() is called to convert it to a loggable string.

    Attributes
    protected[this]
    Definition Classes
    Logging

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Logging

Inherited from RegressionFeatures[A]

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

Inherited from Model[A, B]

Inherited from (A) ⇒ B

Inherited from Submodel[Double, A, B]

Inherited from Closeable

Inherited from AutoCloseable

Inherited from Identifiable[ModelIdentity]

Inherited from AnyRef

Inherited from Any

Ungrouped