Class

com.salesforce.op.stages.impl.regression

OpLinearRegression

Related Doc: package regression

Permalink

class OpLinearRegression extends OpPredictorWrapper[LinearRegression, LinearRegressionModel] with OpLinearRegressionParams

Wrapper around spark ml linear regression org.apache.spark.ml.regression.LinearRegression

Linear Supertypes
OpLinearRegressionParams, LinearRegressionParams, HasAggregationDepth, HasSolver, HasWeightCol, HasStandardization, HasFitIntercept, HasTol, HasMaxIter, HasElasticNetParam, HasRegParam, PredictorParams, HasPredictionCol, HasFeaturesCol, HasLabelCol, OpPredictorWrapper[LinearRegression, LinearRegressionModel], SparkWrapperParams[LinearRegression], OpPipelineStage2[RealNN, OPVector, Prediction], HasIn2, HasIn1, OpPipelineStage[Prediction], OpPipelineStageBase, MLWritable, OpPipelineStageParams, InputParams, Estimator[OpPredictorWrapperModel[LinearRegressionModel]], PipelineStage, Logging, Params, Serializable, Serializable, Identifiable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. OpLinearRegression
  2. OpLinearRegressionParams
  3. LinearRegressionParams
  4. HasAggregationDepth
  5. HasSolver
  6. HasWeightCol
  7. HasStandardization
  8. HasFitIntercept
  9. HasTol
  10. HasMaxIter
  11. HasElasticNetParam
  12. HasRegParam
  13. PredictorParams
  14. HasPredictionCol
  15. HasFeaturesCol
  16. HasLabelCol
  17. OpPredictorWrapper
  18. SparkWrapperParams
  19. OpPipelineStage2
  20. HasIn2
  21. HasIn1
  22. OpPipelineStage
  23. OpPipelineStageBase
  24. MLWritable
  25. OpPipelineStageParams
  26. InputParams
  27. Estimator
  28. PipelineStage
  29. Logging
  30. Params
  31. Serializable
  32. Serializable
  33. Identifiable
  34. AnyRef
  35. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new OpLinearRegression(uid: String = UID[OpLinearRegression])

    Permalink

Type Members

  1. final type InputFeatures = (FeatureLike[RealNN], FeatureLike[OPVector])

    Permalink
    Definition Classes
    OpPipelineStage2 → OpPipelineStage → InputParams
  2. final type OutputFeatures = FeatureLike[Prediction]

    Permalink
    Definition Classes
    OpPipelineStage → OpPipelineStageBase

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 $[T](param: Param[T]): T

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  4. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  5. final val aggregationDepth: IntParam

    Permalink
    Definition Classes
    HasAggregationDepth
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. final def checkInputLength(features: Array[_]): Boolean

    Permalink
    Definition Classes
    OpPipelineStage2 → InputParams
  8. def checkSerializable: Try[Unit]

    Permalink
    Definition Classes
    OpPipelineStageBase
  9. final def clear(param: Param[_]): OpLinearRegression.this.type

    Permalink
    Definition Classes
    Params
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. final def copy(extra: ParamMap): OpLinearRegression.this.type

    Permalink
    Definition Classes
    OpPipelineStageBase → Params
  12. def copyValues[T <: Params](to: T, extra: ParamMap): T

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  13. final def defaultCopy[T <: Params](extra: ParamMap): T

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  14. final val elasticNetParam: DoubleParam

    Permalink
    Definition Classes
    HasElasticNetParam
  15. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  17. def explainParam(param: Param[_]): String

    Permalink
    Definition Classes
    Params
  18. def explainParams(): String

    Permalink
    Definition Classes
    Params
  19. final def extractParamMap(): ParamMap

    Permalink
    Definition Classes
    Params
  20. final def extractParamMap(extra: ParamMap): ParamMap

    Permalink
    Definition Classes
    Params
  21. final val featuresCol: Param[String]

    Permalink
    Definition Classes
    HasFeaturesCol
  22. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  23. def fit(dataset: Dataset[_]): OpPredictorWrapperModel[LinearRegressionModel]

    Permalink

    Function that fits the binary model

    Function that fits the binary model

    Definition Classes
    OpPredictorWrapper → Estimator
  24. def fit(dataset: Dataset[_], paramMaps: Array[ParamMap]): Seq[OpPredictorWrapperModel[LinearRegressionModel]]

    Permalink
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" )
  25. def fit(dataset: Dataset[_], paramMap: ParamMap): OpPredictorWrapperModel[LinearRegressionModel]

    Permalink
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" )
  26. def fit(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): OpPredictorWrapperModel[LinearRegressionModel]

    Permalink
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" ) @varargs()
  27. final val fitIntercept: BooleanParam

    Permalink
    Definition Classes
    HasFitIntercept
  28. final def get[T](param: Param[T]): Option[T]

    Permalink
    Definition Classes
    Params
  29. final def getAggregationDepth: Int

    Permalink
    Definition Classes
    HasAggregationDepth
  30. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  31. final def getDefault[T](param: Param[T]): Option[T]

    Permalink
    Definition Classes
    Params
  32. final def getElasticNetParam: Double

    Permalink
    Definition Classes
    HasElasticNetParam
  33. final def getFeaturesCol: String

    Permalink
    Definition Classes
    HasFeaturesCol
  34. final def getFitIntercept: Boolean

    Permalink
    Definition Classes
    HasFitIntercept
  35. final def getInputFeature[T <: FeatureType](i: Int): Option[FeatureLike[T]]

    Permalink
    Definition Classes
    InputParams
  36. final def getInputFeatures(): Array[OPFeature]

    Permalink
    Definition Classes
    InputParams
  37. final def getInputSchema(): StructType

    Permalink
    Definition Classes
    OpPipelineStageParams
  38. final def getLabelCol: String

    Permalink
    Definition Classes
    HasLabelCol
  39. final def getMaxIter: Int

    Permalink
    Definition Classes
    HasMaxIter
  40. final def getMetadata(): Metadata

    Permalink
    Definition Classes
    OpPipelineStageParams
  41. final def getOrDefault[T](param: Param[T]): T

    Permalink
    Definition Classes
    Params
  42. def getOutput(): FeatureLike[Prediction]

    Permalink
    Definition Classes
    OpPipelineStage2 → OpPipelineStageBase
  43. final def getOutputFeatureName: String

    Permalink
    Definition Classes
    OpPipelineStage
  44. def getParam(paramName: String): Param[Any]

    Permalink
    Definition Classes
    Params
  45. final def getPredictionCol: String

    Permalink
    Definition Classes
    HasPredictionCol
  46. final def getRegParam: Double

    Permalink
    Definition Classes
    HasRegParam
  47. final def getSolver: String

    Permalink
    Definition Classes
    HasSolver
  48. def getSparkMlStage(): Option[LinearRegression]

    Permalink
    Definition Classes
    SparkWrapperParams
  49. def getStageSavePath(): Option[String]

    Permalink
    Definition Classes
    SparkWrapperParams
  50. final def getStandardization: Boolean

    Permalink
    Definition Classes
    HasStandardization
  51. final def getTol: Double

    Permalink
    Definition Classes
    HasTol
  52. final def getTransientFeature(i: Int): Option[TransientFeature]

    Permalink
    Definition Classes
    InputParams
  53. final def getTransientFeatures(): Array[TransientFeature]

    Permalink
    Definition Classes
    InputParams
  54. final def getWeightCol: String

    Permalink
    Definition Classes
    HasWeightCol
  55. final def hasDefault[T](param: Param[T]): Boolean

    Permalink
    Definition Classes
    Params
  56. def hasParam(paramName: String): Boolean

    Permalink
    Definition Classes
    Params
  57. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  58. final def in1: TransientFeature

    Permalink
    Attributes
    protected
    Definition Classes
    HasIn1
  59. final def in2: TransientFeature

    Permalink
    Attributes
    protected
    Definition Classes
    HasIn2
  60. def initializeLogIfNecessary(isInterpreter: Boolean): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  61. final def inputAsArray(in: InputFeatures): Array[OPFeature]

    Permalink
    Definition Classes
    OpPipelineStage2 → InputParams
  62. val inputParam1Name: String

    Permalink
    Definition Classes
    OpPredictorWrapper
  63. val inputParam2Name: String

    Permalink
    Definition Classes
    OpPredictorWrapper
  64. final def isDefined(param: Param[_]): Boolean

    Permalink
    Definition Classes
    Params
  65. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  66. final def isSet(param: Param[_]): Boolean

    Permalink
    Definition Classes
    Params
  67. def isTraceEnabled(): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  68. final val labelCol: Param[String]

    Permalink
    Definition Classes
    HasLabelCol
  69. def log: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  70. def logDebug(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  71. def logDebug(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  72. def logError(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  73. def logError(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  74. def logInfo(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  75. def logInfo(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  76. def logName: String

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  77. def logTrace(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  78. def logTrace(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  79. def logWarning(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  80. def logWarning(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  81. final val maxIter: IntParam

    Permalink
    Definition Classes
    HasMaxIter
  82. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  85. def onGetMetadata(): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    OpPipelineStageParams
  86. def onSetInput(): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    OpLinearRegression → OpPipelineStageBase
  87. val operationName: String

    Permalink
    Definition Classes
    OpPredictorWrapper → OpPipelineStageBase
  88. final def outputAsArray(out: OutputFeatures): Array[OPFeature]

    Permalink
    Definition Classes
    OpPipelineStage → OpPipelineStageBase
  89. def outputFeatureUid: String

    Permalink
    Attributes
    protected[com.salesforce.op]
    Definition Classes
    OpPipelineStage2 → OpPipelineStage
  90. def outputIsResponse: Boolean

    Permalink
    Definition Classes
    OpPipelineStage
  91. val outputParamName: String

    Permalink
    Definition Classes
    OpPredictorWrapper
  92. lazy val params: Array[Param[_]]

    Permalink
    Definition Classes
    Params
  93. final val predictionCol: Param[String]

    Permalink
    Definition Classes
    HasPredictionCol
  94. val predictor: LinearRegression

    Permalink

    the predictor to wrap

    the predictor to wrap

    Definition Classes
    OpPredictorWrapper
  95. final val regParam: DoubleParam

    Permalink
    Definition Classes
    HasRegParam
  96. def save(path: String): Unit

    Permalink
    Definition Classes
    MLWritable
    Annotations
    @Since( "1.6.0" ) @throws( ... )
  97. final def set(paramPair: ParamPair[_]): OpLinearRegression.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  98. final def set(param: String, value: Any): OpLinearRegression.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  99. final def set[T](param: Param[T], value: T): OpLinearRegression.this.type

    Permalink
    Definition Classes
    Params
  100. def setAggregationDepth(value: Int): OpLinearRegression.this.type

    Permalink

    Suggested depth for treeAggregate (greater than or equal to 2).

    Suggested depth for treeAggregate (greater than or equal to 2). If the dimensions of features or the number of partitions are large, this param could be adjusted to a larger size. Default is 2.

  101. final def setDefault(paramPairs: ParamPair[_]*): OpLinearRegression.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  102. final def setDefault[T](param: Param[T], value: T): OpLinearRegression.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  103. def setElasticNetParam(value: Double): OpLinearRegression.this.type

    Permalink

    Set the ElasticNet mixing parameter.

    Set the ElasticNet mixing parameter. For alpha = 0, the penalty is an L2 penalty. For alpha = 1, it is an L1 penalty. For alpha in (0,1), the penalty is a combination of L1 and L2. Default is 0.0 which is an L2 penalty.

  104. def setFitIntercept(value: Boolean): OpLinearRegression.this.type

    Permalink

    Set if we should fit the intercept.

    Set if we should fit the intercept. Default is true.

  105. final def setInput(features: InputFeatures): OpLinearRegression.this.type

    Permalink
    Definition Classes
    OpPipelineStageBase
  106. final def setInputFeatures[S <: OPFeature](features: Array[S]): OpLinearRegression.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    InputParams
  107. def setMaxIter(value: Int): OpLinearRegression.this.type

    Permalink

    Set the maximum number of iterations.

    Set the maximum number of iterations. Default is 100.

  108. final def setMetadata(m: Metadata): OpLinearRegression.this.type

    Permalink
    Definition Classes
    OpPipelineStageParams
  109. def setOutputFeatureName(name: String): OpLinearRegression.this.type

    Permalink
    Definition Classes
    OpPipelineStage
  110. def setRegParam(value: Double): OpLinearRegression.this.type

    Permalink

    Set the regularization parameter.

    Set the regularization parameter. Default is 0.0.

  111. def setSolver(value: String): OpLinearRegression.this.type

    Permalink

    Set the solver algorithm used for optimization.

    Set the solver algorithm used for optimization. In case of linear regression, this can be "l-bfgs", "normal" and "auto".

    • "l-bfgs" denotes Limited-memory BFGS which is a limited-memory quasi-Newton optimization method.
    • "normal" denotes using Normal Equation as an analytical solution to the linear regression problem. This solver is limited to LinearRegression.MAX_FEATURES_FOR_NORMAL_SOLVER.
    • "auto" (default) means that the solver algorithm is selected automatically. The Normal Equations solver will be used when possible, but this will automatically fall back to iterative optimization methods when needed.
  112. def setSparkMlStage(stage: Option[LinearRegression]): OpLinearRegression.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    SparkWrapperParams
  113. def setStageSavePath(path: String): OpLinearRegression.this.type

    Permalink
    Definition Classes
    SparkWrapperParams
  114. def setStandardization(value: Boolean): OpLinearRegression.this.type

    Permalink

    Whether to standardize the training features before fitting the model.

    Whether to standardize the training features before fitting the model. The coefficients of models will be always returned on the original scale, so it will be transparent for users. Default is true.

    Note

    With/without standardization, the models should be always converged to the same solution when no regularization is applied. In R's GLMNET package, the default behavior is true as well.

  115. def setTol(value: Double): OpLinearRegression.this.type

    Permalink

    Set the convergence tolerance of iterations.

    Set the convergence tolerance of iterations. Smaller value will lead to higher accuracy with the cost of more iterations. Default is 1E-6.

  116. def setWeightCol(value: String): OpLinearRegression.this.type

    Permalink

    Whether to over-/under-sample training instances according to the given weights in weightCol.

    Whether to over-/under-sample training instances according to the given weights in weightCol. If not set or empty, all instances are treated equally (weight 1.0). Default is not set, so all instances have weight one.

  117. final val solver: Param[String]

    Permalink
    Definition Classes
    HasSolver
  118. final val sparkInputColParamNames: StringArrayParam

    Permalink
    Definition Classes
    SparkWrapperParams
  119. final val sparkMlStage: SparkStageParam[LinearRegression]

    Permalink
    Definition Classes
    SparkWrapperParams
  120. final val sparkOutputColParamNames: StringArrayParam

    Permalink
    Definition Classes
    SparkWrapperParams
  121. final def stageName: String

    Permalink
    Definition Classes
    OpPipelineStageBase
  122. final val standardization: BooleanParam

    Permalink
    Definition Classes
    HasStandardization
  123. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    Identifiable → AnyRef → Any
  125. final val tol: DoubleParam

    Permalink
    Definition Classes
    HasTol
  126. final def transformSchema(schema: StructType): StructType

    Permalink
    Definition Classes
    OpPipelineStageBase
  127. def transformSchema(schema: StructType, logging: Boolean): StructType

    Permalink
    Attributes
    protected
    Definition Classes
    PipelineStage
    Annotations
    @DeveloperApi()
  128. implicit val tti1: scala.reflect.api.JavaUniverse.TypeTag[RealNN]

    Permalink
    Definition Classes
    OpPredictorWrapper
  129. implicit val tti2: scala.reflect.api.JavaUniverse.TypeTag[OPVector]

    Permalink
    Definition Classes
    OpPredictorWrapper
  130. implicit val tto: scala.reflect.api.JavaUniverse.TypeTag[Prediction]

    Permalink
    Definition Classes
    OpPredictorWrapper → OpPipelineStage2
  131. implicit val ttov: scala.reflect.api.JavaUniverse.TypeTag[Map[String, Double]]

    Permalink
    Definition Classes
    OpPredictorWrapper → OpPipelineStage2
  132. val uid: String

    Permalink

    stage uid

    stage uid

    Definition Classes
    OpPredictorWrapper → Identifiable
  133. def validateAndTransformSchema(schema: StructType, fitting: Boolean, featuresDataType: DataType): StructType

    Permalink
    Attributes
    protected
    Definition Classes
    PredictorParams
  134. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  137. final val weightCol: Param[String]

    Permalink
    Definition Classes
    HasWeightCol
  138. final def write: MLWriter

    Permalink
    Definition Classes
    OpPipelineStageBase → MLWritable

Inherited from OpLinearRegressionParams

Inherited from LinearRegressionParams

Inherited from HasAggregationDepth

Inherited from HasSolver

Inherited from HasWeightCol

Inherited from HasStandardization

Inherited from HasFitIntercept

Inherited from HasTol

Inherited from HasMaxIter

Inherited from HasElasticNetParam

Inherited from HasRegParam

Inherited from PredictorParams

Inherited from HasPredictionCol

Inherited from HasFeaturesCol

Inherited from HasLabelCol

Inherited from OpPredictorWrapper[LinearRegression, LinearRegressionModel]

Inherited from SparkWrapperParams[LinearRegression]

Inherited from OpPipelineStage2[RealNN, OPVector, Prediction]

Inherited from HasIn2

Inherited from HasIn1

Inherited from OpPipelineStage[Prediction]

Inherited from OpPipelineStageBase

Inherited from MLWritable

Inherited from OpPipelineStageParams

Inherited from InputParams

Inherited from Estimator[OpPredictorWrapperModel[LinearRegressionModel]]

Inherited from PipelineStage

Inherited from Logging

Inherited from Params

Inherited from Serializable

Inherited from Serializable

Inherited from Identifiable

Inherited from AnyRef

Inherited from Any

expertSetParam

setParam

Ungrouped