- class svvamp.ExperimentAnalyzer(base_profile=None, n_samples=1, relative_noise=0.0, absolute_noise=0.0, study_profile_criteria=None, voting_rule_tasks=None, output_dir='out', output_file_suffix='', log_csv=None, ping_period=10)[source]#
Analyze a voting experiment.
The results are stored in several csv files.
- Parameters:
base_profile (Profile, optional) – Profile of the experiment, without added noise.
n_samples (int, optional) – Number of samples for the Monte-Carlo treatment.
relative_noise (float, optional) – Relative noise used by GeneratorProfileNoise.
absolute_noise (float, optional) – Absolute noise used by GeneratorProfileNoise.
study_profile_criteria (StudyProfileCriteria, optional) – Profile criteria to be studied.
voting_rule_tasks (VotingRuleTasks, optional) – Voting rule tasks to be performed.
output_dir (str, optional) – Directory where the outputs will be recorded.
output_file_suffix (str, optional) – Suffix for the output file names.
log_csv (List of str, optional) – Additional information at the end of lines in the csv file.
ping_period (int, optional) – Frequency at which the program prints the number of profiles already analyzed.
Examples
Define an ExperimentAnalyzer with the default options:
>>> experiment_analyzer = ExperimentAnalyzer()
If you specify the profile criteria and/or the voting rule tasks, then the relevant sanity checks are performed:
>>> experiment_analyzer = ExperimentAnalyzer( ... study_profile_criteria=StudyProfileCriteria(boolean_criteria=['exists_condorcet_winner_rk']), ... voting_rule_tasks=VotingRuleTasks(voting_systems=[RuleIRV]) ... ) StudyProfileCriteria: Sanity check was successful. VotingRuleTasks: Sanity check was successful.
Anyway, you can then call the object with experiment_analyzer(). You can override the parameters (like base_profile, n_samples, etc) when making the call. For example: experiment_analyzer(base_profile=another_base_profile).