Skip to content
Snippets Groups Projects
Commit a95ee242 authored by Yuhao Yang's avatar Yuhao Yang Committed by Xiangrui Meng
Browse files

[SPARK-6374] [MLlib] add get for GeneralizedLinearAlgo

I find it's better to have getter for NumFeatures and addIntercept within GeneralizedLinearAlgorithm during actual usage, otherwise I 'll have to get the value through debug.

Author: Yuhao Yang <hhbyyh@gmail.com>

Closes #5058 from hhbyyh/addGetLinear and squashes the following commits:

9dc90e8 [Yuhao Yang] add get for GeneralizedLinearAlgo
parent 981fbafa
No related branches found
No related tags found
No related merge requests found
......@@ -123,6 +123,11 @@ abstract class GeneralizedLinearAlgorithm[M <: GeneralizedLinearModel]
*/
private var useFeatureScaling = false
/**
* The dimension of training features.
*/
def getNumFeatures: Int = this.numFeatures
/**
* The dimension of training features.
*/
......@@ -141,6 +146,11 @@ abstract class GeneralizedLinearAlgorithm[M <: GeneralizedLinearModel]
*/
protected def createModel(weights: Vector, intercept: Double): M
/**
* Get if the algorithm uses addIntercept
*/
def isAddIntercept: Boolean = this.addIntercept
/**
* Set if the algorithm should add an intercept. Default false.
* We set the default to false because adding the intercept will cause memory allocation.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment