Skip to content

Commit b82bd7c

Browse files
committed
Parity in PySpark for ml.features
1 parent 9e2ffb1 commit b82bd7c

File tree

5 files changed

+756
-38
lines changed

5 files changed

+756
-38
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import org.apache.spark.sql.types.DataType
3131
* which is available at [[http://en.wikipedia.org/wiki/Polynomial_expansion]], "In mathematics, an
3232
* expansion of a product of sums expresses it as a sum of products by using the fact that
3333
* multiplication distributes over addition". Take a 2-variable feature vector as an example:
34-
* `(x, y)`, if we want to expand it with degree 2, then we get `(x, y, x * x, x * y, y * y)`.
34+
* `(x, y)`, if we want to expand it with degree 2, then we get `(x, x * x, y, x * y, y * y)`.
3535
*/
3636
@AlphaComponent
3737
class PolynomialExpansion extends UnaryTransformer[Vector, Vector, PolynomialExpansion] {

mllib/src/main/scala/org/apache/spark/ml/param/shared/SharedParamsCodeGen.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ private[shared] object SharedParamsCodeGen {
5858
" For alpha = 0, the penalty is an L2 penalty. For alpha = 1, it is an L1 penalty.",
5959
isValid = "ParamValidators.inRange(0, 1)"),
6060
ParamDesc[Double]("tol", "the convergence tolerance for iterative algorithms"),
61-
ParamDesc[Double]("stepSize", "Step size to be used for each iteration of optimization."))
61+
ParamDesc[Double]("stepSize", "Step size to be used for each iteration of optimization."),
62+
ParamDesc[Double]("p", "the p norm value.", isValid = "ParamValidators.gtEq(1)"))
6263

6364
val code = genSharedParams(params)
6465
val file = "src/main/scala/org/apache/spark/ml/param/shared/sharedParams.scala"

0 commit comments

Comments
 (0)