[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
This commit is contained in:
parent
981fbafa2a
commit
a95ee242b0
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue