Class ParamMap

Object
org.apache.spark.ml.param.ParamMap
All Implemented Interfaces:
Serializable

public final class ParamMap extends Object implements Serializable
A param to value map.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an empty param map.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    apply(Param<T> param)
    Gets the value of the input param or its default value if it does not exist.
    boolean
    contains(Param<?> param)
    Checks whether a parameter is explicitly specified.
    Creates a copy of this param map.
    static ParamMap
    Returns an empty param map.
    filter(Params parent)
    Filters this param map for the given parent.
    <T> scala.Option<T>
    get(Param<T> param)
    Optionally returns the value associated with a param.
    <T> T
    getOrElse(Param<T> param, T default_)
    Returns the value associated with a param or a default value.
    put(Param<T> param, T value)
    Puts a (param, value) pair (overwrites if the input param exists).
    put(ParamPair<?>... paramPairs)
    Puts a list of param pairs (overwrites if the input params exists).
    put(scala.collection.immutable.Seq<ParamPair<?>> paramPairs)
    Puts a list of param pairs (overwrites if the input params exists).
    <T> scala.Option<T>
    remove(Param<T> param)
    Removes a key from this map and returns its value associated previously as an option.
    int
    Number of param pairs in this map.
    scala.collection.immutable.Seq<ParamPair<?>>
    Converts this param map to a sequence of param pairs.
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ParamMap

      public ParamMap()
      Creates an empty param map.
  • Method Details

    • empty

      public static ParamMap empty()
      Returns an empty param map.
      Returns:
      (undocumented)
    • put

      public ParamMap put(ParamPair<?>... paramPairs)
      Puts a list of param pairs (overwrites if the input params exists).
      Parameters:
      paramPairs - (undocumented)
      Returns:
      (undocumented)
    • put

      public <T> ParamMap put(Param<T> param, T value)
      Puts a (param, value) pair (overwrites if the input param exists).
      Parameters:
      param - (undocumented)
      value - (undocumented)
      Returns:
      (undocumented)
    • put

      public ParamMap put(scala.collection.immutable.Seq<ParamPair<?>> paramPairs)
      Puts a list of param pairs (overwrites if the input params exists).
      Parameters:
      paramPairs - (undocumented)
      Returns:
      (undocumented)
    • get

      public <T> scala.Option<T> get(Param<T> param)
      Optionally returns the value associated with a param.
      Parameters:
      param - (undocumented)
      Returns:
      (undocumented)
    • getOrElse

      public <T> T getOrElse(Param<T> param, T default_)
      Returns the value associated with a param or a default value.
      Parameters:
      param - (undocumented)
      default_ - (undocumented)
      Returns:
      (undocumented)
    • apply

      public <T> T apply(Param<T> param)
      Gets the value of the input param or its default value if it does not exist. Raises a NoSuchElementException if there is no value associated with the input param.
      Parameters:
      param - (undocumented)
      Returns:
      (undocumented)
    • contains

      public boolean contains(Param<?> param)
      Checks whether a parameter is explicitly specified.
      Parameters:
      param - (undocumented)
      Returns:
      (undocumented)
    • remove

      public <T> scala.Option<T> remove(Param<T> param)
      Removes a key from this map and returns its value associated previously as an option.
      Parameters:
      param - (undocumented)
      Returns:
      (undocumented)
    • filter

      public ParamMap filter(Params parent)
      Filters this param map for the given parent.
      Parameters:
      parent - (undocumented)
      Returns:
      (undocumented)
    • copy

      public ParamMap copy()
      Creates a copy of this param map.
      Returns:
      (undocumented)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toSeq

      public scala.collection.immutable.Seq<ParamPair<?>> toSeq()
      Converts this param map to a sequence of param pairs.
      Returns:
      (undocumented)
    • size

      public int size()
      Number of param pairs in this map.
      Returns:
      (undocumented)