Class: ParameterSampler
Generator on parameters sampled from given distributions.
Non-deterministic iterable over random candidate combinations for hyper- parameter search. If all parameters are presented as a list, sampling without replacement is performed. If at least one parameter is given as a distribution, sampling with replacement is used. It is highly recommended to use continuous distributions for continuous parameters.
Read more in the User Guide.
Constructors
new ParameterSampler()
new ParameterSampler(
opts
?):ParameterSampler
Parameters
Parameter | Type | Description |
---|---|---|
opts ? | object | - |
opts.n_iter ? | number | Number of parameter settings that are produced. |
opts.param_distributions ? | any | Dictionary with parameters names (str ) as keys and distributions or lists of parameters to try. Distributions must provide a rvs method for sampling (such as those from scipy.stats.distributions). If a list is given, it is sampled uniformly. If a list of dicts is given, first a dict is sampled uniformly, and then a parameter is sampled using that dict as above. |
opts.random_state ? | number | Pseudo random number generator state used for random uniform sampling from lists of possible values instead of scipy.stats distributions. Pass an int for reproducible output across multiple function calls. See Glossary. |
Returns ParameterSampler
Defined in generated/model_selection/ParameterSampler.ts:25
Properties
Property | Type | Default value | Defined in |
---|---|---|---|
_isDisposed | boolean | false | generated/model_selection/ParameterSampler.ts:23 |
_isInitialized | boolean | false | generated/model_selection/ParameterSampler.ts:22 |
_py | PythonBridge | undefined | generated/model_selection/ParameterSampler.ts:21 |
id | string | undefined | generated/model_selection/ParameterSampler.ts:18 |
opts | any | undefined | generated/model_selection/ParameterSampler.ts:19 |
Accessors
params
Get Signature
get params():
Promise
<any
>
Yields* dictionaries mapping each estimator parameter to as sampled value.
Returns Promise
<any
>
Defined in generated/model_selection/ParameterSampler.ts:116
py
Get Signature
get py():
PythonBridge
Returns PythonBridge
Set Signature
set py(
pythonBridge
):void
Parameters
Parameter | Type |
---|---|
pythonBridge | PythonBridge |
Returns void
Defined in generated/model_selection/ParameterSampler.ts:45
Methods
dispose()
dispose():
Promise
<void
>
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
Returns Promise
<void
>
Defined in generated/model_selection/ParameterSampler.ts:99
init()
init(
py
):Promise
<void
>
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
Parameters
Parameter | Type |
---|---|
py | PythonBridge |
Returns Promise
<void
>