Class/Object

com.alpine.model.pack.ml

LinearRegressionModel

Related Docs: object LinearRegressionModel | package ml

Permalink

case class LinearRegressionModel(coefficients: Seq[Double], inputFeatures: Seq[ColumnDef], intercept: Double = 0, dependentFeatureName: String = "", identifier: String = "") extends RegressionRowModel with PFAConvertible with Product with Serializable

Representation of the classical linear regression model y = intercept + a_0 x_0 + a_1 x_1 + ... + a_n x_n.

The length of the coefficients must match the length of the inputFeatures.

We use java.lang.Double for the type of the coefficients, because the scala Double type information is lost by scala/Gson and the deserialization fails badly for edge cases (e.g. Double.NaN).

coefficients

Vector of coefficients of the model. Must match the length of inputFeatures.

inputFeatures

Description of the (numeric) input features. Must match the length of coefficients.

intercept

Intercept of the model (defaults to 0).

dependentFeatureName

Name used to identify the dependent feature in an evaluation dataset.

identifier

Used to identify this model when in a collection of models. Should be simple characters, so it can be used in a feature name.

Annotations
@SerialVersionUID()
Linear Supertypes
Product, Equals, PFAConvertible, RegressionRowModel, RowModel, MLModel, Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LinearRegressionModel
  2. Product
  3. Equals
  4. PFAConvertible
  5. RegressionRowModel
  6. RowModel
  7. MLModel
  8. Serializable
  9. Serializable
  10. AnyRef
  11. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LinearRegressionModel(coefficients: Seq[Double], inputFeatures: Seq[ColumnDef], intercept: Double = 0, dependentFeatureName: String = "", identifier: String = "")

    Permalink

    coefficients

    Vector of coefficients of the model. Must match the length of inputFeatures.

    inputFeatures

    Description of the (numeric) input features. Must match the length of coefficients.

    intercept

    Intercept of the model (defaults to 0).

    dependentFeatureName

    Name used to identify the dependent feature in an evaluation dataset.

    identifier

    Used to identify this model when in a collection of models. Should be simple characters, so it can be used in a feature name.

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. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def classesForLoading: Set[Class[_]]

    Permalink

    This should return a representative class from every jar that is needed to load the object during deserialization.

    This should return a representative class from every jar that is needed to load the object during deserialization.

    Default implementation returns the class of MLModel, and the class of the model implementation.

    Definition Classes
    MLModel
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. val coefficients: Seq[Double]

    Permalink

    Vector of coefficients of the model.

    Vector of coefficients of the model. Must match the length of inputFeatures.

  8. def dependentFeature: ColumnDef

    Permalink

    Used when we are doing model quality evaluation e.g.

    Used when we are doing model quality evaluation e.g. Confusion Matrix, so we know what feature in the test dataset to compare the result to.

    returns

    Feature description used to identify the dependent feature in an evaluation dataset.

    Definition Classes
    LinearRegressionModelRegressionRowModel
  9. val dependentFeatureName: String

    Permalink

    Name used to identify the dependent feature in an evaluation dataset.

  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def finalize(): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  13. def getPFAConverter: PFAConverter

    Permalink
    Definition Classes
    LinearRegressionModelPFAConvertible
  14. val identifier: String

    Permalink

    Used to identify this model when in a collection of models.

    Used to identify this model when in a collection of models. Should be simple characters, so it can be used in a feature name.

    Definition Classes
    LinearRegressionModelRowModel
  15. val inputFeatures: Seq[ColumnDef]

    Permalink

    Description of the (numeric) input features.

    Description of the (numeric) input features. Must match the length of coefficients.

    Definition Classes
    LinearRegressionModelRowModel
  16. val intercept: Double

    Permalink

    Intercept of the model (defaults to 0).

  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  21. def outputFeatures: Seq[ColumnDef]

    Permalink
    Definition Classes
    RegressionRowModelRowModel
  22. def sqlOutputFeatures: Seq[ColumnDef]

    Permalink
    Definition Classes
    RowModel
  23. def sqlTransformer(sqlGenerator: SQLGenerator): Some[LinearRegressionSQLTransformer]

    Permalink
  24. def streamline(requiredOutputFeatureNames: Seq[String]): RegressionRowModel

    Permalink

    Returns a streamlined version of this model, throwing away parts which are not required to produce the features with names in requiredOutputFeatureNames.

    Returns a streamlined version of this model, throwing away parts which are not required to produce the features with names in requiredOutputFeatureNames.

    Behaviour is undefined if requiredOutputFeatureNames is not actually a subset of outputFeatures.map(_columnName).

    The resulting model may still have more output features than those required (i.e. for ClassificationRowModel implementations which always have the same output features, or for OneHotEncodingModel whose output features naturally group together).

    requiredOutputFeatureNames

    names of the output features that the new model should produce.

    returns

    A model which has the same functionality for those output features listed, but potentially fewer input features.

    Definition Classes
    LinearRegressionModelRegressionRowModelRowModel
  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  26. def transformationSchema: DetailedTransformationSchema

    Permalink
    Definition Classes
    RowModel
  27. def transformer: LinearRegressionTransformer

    Permalink
  28. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Product

Inherited from Equals

Inherited from PFAConvertible

Inherited from RegressionRowModel

Inherited from RowModel

Inherited from MLModel

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped