def _calc_uia(self, oracle_history, majority_vote_result, alpha=0.05):
    'Calculate the UI(a) by providing the labeling history and the majority vote results.\n\n        Parameters\n        ----------\n        oracle_history: dict\n            The labeling history of an oracle. The key is the index of instance, the value is the\n            label given by the oracle.\n\n        majority_vote_result: dict\n            The results of majority vote of instances. The key is the index of instance,\n            the value is the label given by the oracle.\n\n        alpha: float, optional (default=0.05)\n            Used for calculating the critical value for the Student’s t-distribution with n−1\n            degrees of freedom at the alpha/2 confidence level.\n\n        Returns\n        -------\n        uia: float\n            The UI(a) value.\n        '
    n = len(self._oracles_iterset)
    t_crit_val = scipy.stats.t.isf([(alpha / 2)], (n - 1))[0]
    reward_arr = []
    for ind in oracle_history.keys():
        if (oracle_history[ind] == majority_vote_result[ind]):
            reward_arr.append(1)
        else:
            reward_arr.append(0)
    mean_a = np.mean(reward_arr)
    std_a = np.std(reward_arr)
    uia = (mean_a + ((t_crit_val * std_a) / np.sqrt(n)))
    return uia
Calculate the UI(a) by providing the labeling history and the majority vote results.

Parameters
----------
oracle_history: dict
    The labeling history of an oracle. The key is the index of instance, the value is the
    label given by the oracle.

majority_vote_result: dict
    The results of majority vote of instances. The key is the index of instance,
    the value is the label given by the oracle.

alpha: float, optional (default=0.05)
    Used for calculating the critical value for the Student’s t-distribution with n−1
    degrees of freedom at the alpha/2 confidence level.

Returns
-------
uia: float
    The UI(a) value.
def _calc_uia(self, oracle_history, majority_vote_result, alpha=0.05):
    'Calculate the UI(a) by providing the labeling history and the majority vote results.\n\n        Parameters\n        ----------\n        oracle_history: dict\n            The labeling history of an oracle. The key is the index of instance, the value is the\n            label given by the oracle.\n\n        majority_vote_result: dict\n            The results of majority vote of instances. The key is the index of instance,\n            the value is the label given by the oracle.\n\n        alpha: float, optional (default=0.05)\n            Used for calculating the critical value for the Student’s t-distribution with n−1\n            degrees of freedom at the alpha/2 confidence level.\n\n        Returns\n        -------\n        uia: float\n            The UI(a) value.\n        '
    n = len(self._oracles_iterset)
    t_crit_val = scipy.stats.t.isf([(alpha / 2)], (n - 1))[0]
    reward_arr = []
    for ind in oracle_history.keys():
        if (oracle_history[ind] == majority_vote_result[ind]):
            reward_arr.append(1)
        else:
            reward_arr.append(0)
    mean_a = np.mean(reward_arr)
    std_a = np.std(reward_arr)
    uia = (mean_a + ((t_crit_val * std_a) / np.sqrt(n)))
    return uia