Truth Generator General

class embedded_voting.TruthGeneratorGeneral(function=None)[source]

A general generator for the ground truth (“true value”) of each candidate.

The true value of each candidate is independent and follow a probability distribution defined by the function function.

Parameters:function (None -> np.ndarray float) – The function that defines the probability distribution of the true value of each candidate. If None, the normal distribution is used.

Examples

>>> np.random.seed(42)
>>> truth_generator = TruthGeneratorGeneral()
>>> truth_generator(n_candidates=3)
array([ 0.49671415, -0.1382643 ,  0.64768854])