Skip to content

Commit

Permalink
Parity in PySpark for ml.features
Browse files Browse the repository at this point in the history
  • Loading branch information
brkyvz committed May 7, 2015
1 parent 9e2ffb1 commit b82bd7c
Show file tree
Hide file tree
Showing 5 changed files with 756 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import org.apache.spark.sql.types.DataType
* which is available at [[http://en.wikipedia.org/wiki/Polynomial_expansion]], "In mathematics, an
* expansion of a product of sums expresses it as a sum of products by using the fact that
* multiplication distributes over addition". Take a 2-variable feature vector as an example:
* `(x, y)`, if we want to expand it with degree 2, then we get `(x, y, x * x, x * y, y * y)`.
* `(x, y)`, if we want to expand it with degree 2, then we get `(x, x * x, y, x * y, y * y)`.
*/
@AlphaComponent
class PolynomialExpansion extends UnaryTransformer[Vector, Vector, PolynomialExpansion] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ private[shared] object SharedParamsCodeGen {
" For alpha = 0, the penalty is an L2 penalty. For alpha = 1, it is an L1 penalty.",
isValid = "ParamValidators.inRange(0, 1)"),
ParamDesc[Double]("tol", "the convergence tolerance for iterative algorithms"),
ParamDesc[Double]("stepSize", "Step size to be used for each iteration of optimization."))
ParamDesc[Double]("stepSize", "Step size to be used for each iteration of optimization."),
ParamDesc[Double]("p", "the p norm value.", isValid = "ParamValidators.gtEq(1)"))

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

0 comments on commit b82bd7c

Please sign in to comment.