KernelDensityStrategy
- class aixd.sampler.strategies.KernelDensityStrategy(features: DataObject | List[DataObject], bandwidth: float = 0.05, engine: SamplingEngine | str = 'random', **kwargs)[source]
Bases:
Strategy
Fits a multivariate Kernel Density Estimator to the features. Allows to sample according to some prior distribution provided by the user through the “fit” function. https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KernelDensity.html
- Parameters:
features (Union[DataObject, List[DataObject]]) – The features refer to the data objects, which contain the information about the domain of the features.
bandwidth (float, optional, default=0.05) – The badnwidth of the kernel for the KDE.
engine (Union[SamplingEngine, str], optional, default=”random”) – In this case the default engine is “random”, as it is the only one that makes sense to use with this strategy.
Methods
Fit the strategy to the data, also using some vectors of objectives and validity values.
Reset the state of the engine.
Add the log-likelihood of the samples to the objectives.