Skip to content

Commit

Permalink
[SPARK-5726] [MLLIB] Use new createTransformFunc.
Browse files Browse the repository at this point in the history
  • Loading branch information
ogeagla committed May 7, 2015
1 parent 90f7e39 commit fac12ad
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package org.apache.spark.ml.feature

import org.apache.spark.annotation.AlphaComponent
import org.apache.spark.ml.UnaryTransformer
import org.apache.spark.ml.param.{Param, ParamMap}
import org.apache.spark.ml.param.Param
import org.apache.spark.mllib.feature
import org.apache.spark.mllib.linalg.{Vector, VectorUDT}
import org.apache.spark.sql.types.DataType
Expand All @@ -45,9 +45,9 @@ class ElementwiseProduct extends UnaryTransformer[Vector, Vector, ElementwisePro
/** @group getParam */
def getScalingVec: Vector = getOrDefault(scalingVec)

override protected def createTransformFunc(paramMap: ParamMap): Vector => Vector = {
require(paramMap.contains(scalingVec), s"transformation requires a weight vector: $scalingVec")
val elemScaler = new feature.ElementwiseProduct(paramMap(scalingVec))
override protected def createTransformFunc: Vector => Vector = {
require(params.contains(scalingVec), s"transformation requires a weight vector")
val elemScaler = new feature.ElementwiseProduct($(scalingVec))
elemScaler.transform
}

Expand Down

0 comments on commit fac12ad

Please sign in to comment.