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.
Python Reference (opens in a new tab)
Constructors
constructor()
Signature
new ParameterSampler(opts?: object): ParameterSampler;
Parameters
Name | 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
Defined in: generated/model_selection/ParameterSampler.ts:25 (opens in a new tab)
Properties
_isDisposed
boolean
=false
Defined in: generated/model_selection/ParameterSampler.ts:23 (opens in a new tab)
_isInitialized
boolean
=false
Defined in: generated/model_selection/ParameterSampler.ts:22 (opens in a new tab)
_py
PythonBridge
Defined in: generated/model_selection/ParameterSampler.ts:21 (opens in a new tab)
id
string
Defined in: generated/model_selection/ParameterSampler.ts:18 (opens in a new tab)
opts
any
Defined in: generated/model_selection/ParameterSampler.ts:19 (opens in a new tab)
Accessors
params
Yields* dictionaries mapping each estimator parameter to as sampled value.
Signature
params(): Promise<any>;
Returns
Promise
<any
>
Defined in: generated/model_selection/ParameterSampler.ts:119 (opens in a new tab)
py
Signature
py(): PythonBridge;
Returns
PythonBridge
Defined in: generated/model_selection/ParameterSampler.ts:45 (opens in a new tab)
Signature
py(pythonBridge: PythonBridge): void;
Parameters
Name | Type |
---|---|
pythonBridge | PythonBridge |
Returns
void
Defined in: generated/model_selection/ParameterSampler.ts:49 (opens in a new tab)
Methods
dispose()
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
Signature
dispose(): Promise<void>;
Returns
Promise
<void
>
Defined in: generated/model_selection/ParameterSampler.ts:102 (opens in a new tab)
init()
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
Signature
init(py: PythonBridge): Promise<void>;
Parameters
Name | Type |
---|---|
py | PythonBridge |
Returns
Promise
<void
>
Defined in: generated/model_selection/ParameterSampler.ts:58 (opens in a new tab)