Skip to content

Commit

Permalink
remove protected to be compatible with 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxr committed Mar 27, 2014
1 parent 0e57aa4 commit a104072
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ abstract class GeneralizedLinearModel(val weights: Array[Double], val intercept:
* @param weightMatrix Column vector containing the weights of the model
* @param intercept Intercept of the model.
*/
protected def predictPoint(dataMatrix: DoubleMatrix, weightMatrix: DoubleMatrix,
def predictPoint(dataMatrix: DoubleMatrix, weightMatrix: DoubleMatrix,
intercept: Double): Double

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class LassoModel(
extends GeneralizedLinearModel(weights, intercept)
with RegressionModel with Serializable {

override protected def predictPoint(
override def predictPoint(
dataMatrix: DoubleMatrix,
weightMatrix: DoubleMatrix,
intercept: Double): Double = {
Expand Down Expand Up @@ -85,7 +85,7 @@ class LassoWithSGD private (
this
}

override protected def createModel(weights: Array[Double], intercept: Double) = {
override def createModel(weights: Array[Double], intercept: Double) = {
val weightsMat = new DoubleMatrix(weights.length, 1, weights: _*)
val weightsScaled = weightsMat.div(xColSd)
val interceptScaled = yMean - weightsMat.transpose().mmul(xColMean.div(xColSd)).get(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class LinearRegressionModel(
override val intercept: Double)
extends GeneralizedLinearModel(weights, intercept) with RegressionModel with Serializable {

override protected def predictPoint(
override def predictPoint(
dataMatrix: DoubleMatrix,
weightMatrix: DoubleMatrix,
intercept: Double): Double = {
Expand Down Expand Up @@ -69,7 +69,7 @@ class LinearRegressionWithSGD private (
*/
def this() = this(1.0, 100, 1.0)

override protected def createModel(weights: Array[Double], intercept: Double) = {
override def createModel(weights: Array[Double], intercept: Double) = {
new LinearRegressionModel(weights, intercept)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class RidgeRegressionModel(
extends GeneralizedLinearModel(weights, intercept)
with RegressionModel with Serializable {

override protected def predictPoint(
override def predictPoint(
dataMatrix: DoubleMatrix,
weightMatrix: DoubleMatrix,
intercept: Double): Double = {
Expand Down Expand Up @@ -86,7 +86,7 @@ class RidgeRegressionWithSGD private (
this
}

override protected def createModel(weights: Array[Double], intercept: Double) = {
override def createModel(weights: Array[Double], intercept: Double) = {
val weightsMat = new DoubleMatrix(weights.length, 1, weights: _*)
val weightsScaled = weightsMat.div(xColSd)
val interceptScaled = yMean - weightsMat.transpose().mmul(xColMean.div(xColSd)).get(0)
Expand Down

0 comments on commit a104072

Please sign in to comment.