Skip to content

Commit db0ac93

Browse files
committed
address comments
1 parent 1e47a11 commit db0ac93

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

mllib/src/main/scala/org/apache/spark/ml/feature/Instance.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@ private[ml] case class OffsetInstance(
4444
offset: Double,
4545
features: Vector) {
4646

47-
/** Constructs from an [[Instance]] object and offset */
48-
def this(instance: Instance, offset: Double = 0.0) = {
49-
this(instance.label, instance.weight, offset, instance.features)
50-
}
51-
5247
/** Converts to an [[Instance]] object by leaving out the offset. */
53-
private[ml] def toInstance: Instance = Instance(label, weight, features)
48+
def toInstance: Instance = Instance(label, weight, features)
5449

5550
}

mllib/src/main/scala/org/apache/spark/ml/regression/GeneralizedLinearRegression.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,12 @@ private[regression] trait GeneralizedLinearRegressionBase extends PredictorParam
139139
* as 0.0. The feature specified as offset has a constant coefficient of 1.0.
140140
* @group param
141141
*/
142+
@Since("2.3.0")
142143
final val offsetCol: Param[String] = new Param[String](this, "offsetCol", "The offset " +
143144
"column name. If this is not set or empty, we treat all instance offsets as 0.0")
144145

145146
/** @group getParam */
147+
@Since("2.3.0")
146148
def getOffsetCol: String = $(offsetCol)
147149

148150
/** Checks whether weight column is set and nonempty. */
@@ -333,7 +335,7 @@ class GeneralizedLinearRegression @Since("2.0.0") (@Since("2.0.0") override val
333335
*
334336
* @group setParam
335337
*/
336-
@Since("2.2.0")
338+
@Since("2.3.0")
337339
def setOffsetCol(value: String): this.type = set(offsetCol, value)
338340

339341
/**
@@ -990,7 +992,7 @@ class GeneralizedLinearRegressionModel private[ml] (
990992
/**
991993
* Calculates the predicted value when offset is set.
992994
*/
993-
def predict(features: Vector, offset: Double): Double = {
995+
private def predict(features: Vector, offset: Double): Double = {
994996
val eta = predictLink(features, offset)
995997
familyAndLink.fitted(eta)
996998
}

0 commit comments

Comments
 (0)