calc_prod, envs, strict=True, all_info=False, ordered_pair=None, stop_check=None, call_back=None)[source]

Main function for calculating predictability of distribution for two segments over specified environments in a corpus.


Context manager for a corpus

envslist of EnvironmentFilter

List of EnvironmentFilter objects that specify environments


If true, exceptions will be raised for non-exhausive environments and non-unique environments. If false, only warnings will be shown. Defaults to True.


If true, all the intermediate numbers for calculating predictability of distribution will be returned. If false, only the final entropy will be returned. Defaults to False.

stop_checkcallable, optional

Optional function to check whether to gracefully terminate early

call_backcallable, optional

Optional function to supply progress information during the function


Keys are the environments specified and values are either a list of [entropy, frequency of environment, frequency of seg1, frequency of seg2] if all_info is True, or just entropy if all_info is False.