View Source CEM.Sample (cem v0.1.1)
Module for generating a sample of instance-score pairs from the instance-generating probability distribution.
Summary
Functions
Given parameters of the instance-generating probability distribution, generate the elite sample of instances and the smallest (maximization problem) or largest (minimization problem) score of that sample.
Reduce a stream of instance-score pairs into the elite sample and the score associated with that sample.
Return a stream of instance-score pairs.
Types
@type instance() :: any()
@type opts() :: map()
@type params() :: any()
@type score() :: float()
@type step() :: non_neg_integer()
Functions
generate_elite_sample_and_score(params, draw_fn, score_instnace_fn, opts)
View Source@spec generate_elite_sample_and_score(params(), draw_fn(), score_fn(), opts()) :: {[instance()], score()}
Given parameters of the instance-generating probability distribution, generate the elite sample of instances and the smallest (maximization problem) or largest (minimization problem) score of that sample.
@spec reduce_to_elite_sample_and_score(Enumerable.t(), opts()) :: {[instance()], score()}
Reduce a stream of instance-score pairs into the elite sample and the score associated with that sample.
@spec stream_instances_and_scores(params(), draw_fn(), score_fn()) :: Enumerable.t()
Return a stream of instance-score pairs.