Class ElementwiseProduct

All Implemented Interfaces:
Serializable, org.apache.spark.internal.Logging, Params, HasInputCol, HasOutputCol, DefaultParamsWritable, Identifiable, MLWritable

public class ElementwiseProduct extends UnaryTransformer<Vector,Vector,ElementwiseProduct> implements DefaultParamsWritable
Outputs the Hadamard product (i.e., the element-wise product) of each input vector with a provided "weight" vector. In other words, it scales each column of the dataset by a scalar multiplier.
See Also:
  • Constructor Details

    • ElementwiseProduct

      public ElementwiseProduct(String uid)
    • ElementwiseProduct

      public ElementwiseProduct()
  • Method Details

    • load

      public static ElementwiseProduct load(String path)
    • read

      public static MLReader<T> read()
    • uid

      public String uid()
      Description copied from interface: Identifiable
      An immutable unique ID for the object and its derivatives.
      Specified by:
      uid in interface Identifiable
      Returns:
      (undocumented)
    • scalingVec

      public Param<Vector> scalingVec()
      the vector to multiply with input vectors
      Returns:
      (undocumented)
    • setScalingVec

      public ElementwiseProduct setScalingVec(Vector value)
    • getScalingVec

      public Vector getScalingVec()
    • transformSchema

      public StructType transformSchema(StructType schema)
      Description copied from class: PipelineStage
      Check transform validity and derive the output schema from the input schema.

      We check validity for interactions between parameters during transformSchema and raise an exception if any parameter value is invalid. Parameter value checks which do not depend on other parameters are handled by Param.validate().

      Typical implementation should first conduct verification on schema change and parameter validity, including complex parameter interaction checks.

      Overrides:
      transformSchema in class UnaryTransformer<Vector,Vector,ElementwiseProduct>
      Parameters:
      schema - (undocumented)
      Returns:
      (undocumented)
    • toString

      public String toString()
      Specified by:
      toString in interface Identifiable
      Overrides:
      toString in class Object