DocumentationClassesParameterSampler

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.

Python Reference

Constructors

new ParameterSampler()

new ParameterSampler(opts?): ParameterSampler

Parameters

ParameterTypeDescription
opts?object-
opts.n_iter?numberNumber of parameter settings that are produced.
opts.param_distributions?anyDictionary 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?numberPseudo 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

PropertyTypeDefault valueDefined in
_isDisposedbooleanfalsegenerated/model_selection/ParameterSampler.ts:23
_isInitializedbooleanfalsegenerated/model_selection/ParameterSampler.ts:22
_pyPythonBridgeundefinedgenerated/model_selection/ParameterSampler.ts:21
idstringundefinedgenerated/model_selection/ParameterSampler.ts:18
optsanyundefinedgenerated/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

ParameterType
pythonBridgePythonBridge

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

ParameterType
pyPythonBridge

Returns Promise<void>

Defined in generated/model_selection/ParameterSampler.ts:58