Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/7952#discussion_r36370657
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/regression/IsotonicRegression.scala ---
@@ -17,44 +17,111 @@
package org.apache.spark.ml.regression
+import org.apache.spark.Logging
import org.apache.spark.annotation.Experimental
-import org.apache.spark.ml.PredictorParams
-import org.apache.spark.ml.param.{Param, ParamMap, BooleanParam}
-import org.apache.spark.ml.util.{SchemaUtils, Identifiable}
-import org.apache.spark.mllib.regression.{IsotonicRegression =>
MLlibIsotonicRegression}
-import org.apache.spark.mllib.regression.{IsotonicRegressionModel =>
MLlibIsotonicRegressionModel}
+import org.apache.spark.ml.{Estimator, Model}
+import org.apache.spark.ml.param._
+import org.apache.spark.ml.param.shared.{HasFeaturesCol, HasLabelCol,
HasPredictionCol}
+import org.apache.spark.ml.util.{Identifiable, SchemaUtils}
+import org.apache.spark.mllib.linalg.{Vector, VectorUDT, Vectors}
+import org.apache.spark.mllib.regression.{IsotonicRegression =>
MLlibIsotonicRegression, IsotonicRegressionModel =>
MLlibIsotonicRegressionModel}
import org.apache.spark.rdd.RDD
-import org.apache.spark.sql.types.{DoubleType, DataType}
-import org.apache.spark.sql.{Row, DataFrame}
+import org.apache.spark.sql.{DataFrame, Row}
+import org.apache.spark.sql.functions.{col, lit, udf}
+import org.apache.spark.sql.types.{DoubleType, StructType}
import org.apache.spark.storage.StorageLevel
/**
* Params for isotonic regression.
*/
-private[regression] trait IsotonicRegressionParams extends PredictorParams
{
+private[regression] trait IsotonicRegressionBase extends Params with
HasFeaturesCol
+ with HasLabelCol with HasPredictionCol with Logging {
/**
- * Param for weight column name.
- * TODO: Move weightCol to sharedParams.
- *
+ * Param for weight column name (default: none).
* @group param
*/
+ // TODO: Move weightCol to sharedParams.
final val weightCol: Param[String] =
- new Param[String](this, "weightCol", "weight column name")
+ new Param[String](this, "weightCol",
+ "weight column name. If this is not set or empty, we treat all
instance weights as 1.0.")
/** @group getParam */
final def getWeightCol: String = $(weightCol)
/**
- * Param for isotonic parameter.
- * Isotonic (increasing) or antitonic (decreasing) sequence.
+ * Param for whether the output sequence should be isotonic/increasing
(true) or
+ * antitonic/decreasing (false).
* @group param
*/
final val isotonic: BooleanParam =
new BooleanParam(this, "isotonic", "isotonic (increasing) or antitonic
(decreasing) sequence")
/** @group getParam */
- final def getIsotonicParam: Boolean = $(isotonic)
+ final def getIsotonic: Boolean = $(isotonic)
+
+ /**
+ * Param for the index of the feature if [[featuresCol]] is a vector
column (default: `1`), no
--- End diff --
wrong default
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]