public interface Params extends Identifiable, scala.Serializable
Modifier and Type | Method and Description |
---|---|
Params |
clear(Param<?> param) |
Params |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
<T extends Params> |
copyValues(T to,
ParamMap extra)
Copies param values from this instance to another instance for params shared by them.
|
<T extends Params> |
defaultCopy(ParamMap extra)
Default implementation of copy with extra params.
|
ParamMap |
defaultParamMap()
Internal param map for default values.
|
java.lang.String |
explainParam(Param<?> param) |
java.lang.String |
explainParams() |
ParamMap |
extractParamMap()
extractParamMap with no extra values. |
ParamMap |
extractParamMap(ParamMap extra)
Extracts the embedded default param values and user-supplied values, and then merges them with
extra values from input into a flat param map, where the latter value is used if there exist
conflicts, i.e., with ordering: default param values < user-supplied values < extra.
|
<T> scala.Option<T> |
get(Param<T> param) |
<T> scala.Option<T> |
getDefault(Param<T> param)
Gets the default value of a parameter.
|
<T> T |
getOrDefault(Param<T> param)
Gets the value of a param in the embedded param map or its default value.
|
Param<java.lang.Object> |
getParam(java.lang.String paramName) |
<T> boolean |
hasDefault(Param<T> param)
Tests whether the input param has a default value set.
|
boolean |
hasParam(java.lang.String paramName) |
boolean |
isDefined(Param<?> param) |
boolean |
isSet(Param<?> param) |
ParamMap |
paramMap()
Internal param map for user-supplied values.
|
Param<?>[] |
params() |
<T> Params |
set(Param<T> param,
T value) |
Params |
set(ParamPair<?> paramPair) |
Params |
set(java.lang.String param,
java.lang.Object value) |
<T> Params |
setDefault(Param<T> param,
T value)
Sets a default value for a param.
|
Params |
setDefault(scala.collection.Seq<ParamPair<?>> paramPairs)
Sets default values for a list of params.
|
void |
shouldOwn(Param<?> param)
Validates that the input param belongs to this instance.
|
void |
validateParams() |
toString, uid
Param<?>[] params()
void validateParams()
java.lang.String explainParam(Param<?> param)
java.lang.String explainParams()
boolean isSet(Param<?> param)
boolean isDefined(Param<?> param)
boolean hasParam(java.lang.String paramName)
Param<java.lang.Object> getParam(java.lang.String paramName)
Params set(java.lang.String param, java.lang.Object value)
<T> scala.Option<T> get(Param<T> param)
<T> T getOrDefault(Param<T> param)
param
- (undocumented)<T> Params setDefault(Param<T> param, T value)
param
- param to set the default value. Make sure that this param is initialized before
this method gets called.value
- the default valueParams setDefault(scala.collection.Seq<ParamPair<?>> paramPairs)
Note: Java developers should use the single-parameter setDefault()
.
Annotating this with varargs can cause compilation failures due to a Scala compiler bug.
See SPARK-9268.
paramPairs
- a list of param pairs that specify params and their default values to set
respectively. Make sure that the params are initialized before this method
gets called.<T> scala.Option<T> getDefault(Param<T> param)
param
- (undocumented)<T> boolean hasDefault(Param<T> param)
param
- (undocumented)Params copy(ParamMap extra)
extra
- (undocumented)defaultCopy()
<T extends Params> T defaultCopy(ParamMap extra)
extra
- (undocumented)ParamMap extractParamMap(ParamMap extra)
extra
- (undocumented)ParamMap extractParamMap()
extractParamMap
with no extra values.ParamMap paramMap()
ParamMap defaultParamMap()
void shouldOwn(Param<?> param)
<T extends Params> T copyValues(T to, ParamMap extra)
This handles default Params and explicitly set Params separately.
Default Params are copied from and to defaultParamMap
, and explicitly set Params are
copied from and to paramMap
.
Warning: This implicitly assumes that this Params
instance and the target instance
share the same set of default Params.
to
- the target instance, which should work with the same set of default Params as this
source instanceextra
- extra params to be copied to the target's paramMap