public interface Params extends Identifiable, scala.Serializable
Modifier and Type | Method and Description |
---|---|
Params |
clear(Param<?> param)
Clears the user-supplied value for the input 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)
Explains a param.
|
java.lang.String |
explainParams()
Explains all params of this instance.
|
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)
Optionally returns the user-supplied value of a 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)
Gets a param by its name.
|
<T> boolean |
hasDefault(Param<T> param)
Tests whether the input param has a default value set.
|
boolean |
hasParam(java.lang.String paramName)
Tests whether this instance contains a param with a given name.
|
boolean |
isDefined(Param<?> param)
Checks whether a param is explicitly set or has a default value.
|
boolean |
isSet(Param<?> param)
Checks whether a param is explicitly set.
|
ParamMap |
paramMap()
Internal param map for user-supplied values.
|
Param<?>[] |
params()
Returns all params sorted by their names.
|
<T> Params |
set(Param<T> param,
T value)
Sets a parameter in the embedded param map.
|
Params |
set(ParamPair<?> paramPair)
Sets a parameter in the embedded param map.
|
Params |
set(java.lang.String param,
java.lang.Object value)
Sets a parameter (by name) in the embedded param map.
|
<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()
Validates parameter values stored internally.
|
toString, uid
Param<?>[] params()
Param
.
Note: Developer should not use this method in constructor because we cannot guarantee that this variable gets initialized before other params.
void validateParams()
This only needs to check for interactions between parameters.
Parameter value checks which do not depend on other parameters are handled by
Param.validate()
. This method does not handle input/output column parameters;
those are checked during schema validation.
java.lang.String explainParam(Param<?> param)
param
- input param, must belong to this instance.java.lang.String explainParams()
explainParam()
boolean isSet(Param<?> param)
boolean isDefined(Param<?> param)
boolean hasParam(java.lang.String paramName)
Param<java.lang.Object> getParam(java.lang.String paramName)
<T> Params set(Param<T> param, T value)
param
- (undocumented)value
- (undocumented)Params set(java.lang.String param, java.lang.Object value)
param
- (undocumented)value
- (undocumented)Params set(ParamPair<?> paramPair)
paramPair
- (undocumented)<T> scala.Option<T> get(Param<T> param)
param
- (undocumented)Params clear(Param<?> param)
param
- (undocumented)<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