(self, target, models)
return Uncertainty
Calculate the uncertainty.
        target: unlabel_martix
Calculate the uncertainty.
        target: unlabel_martix
Calculate the uncertainty . target : unlabel_martix
def cal_uncertainty(self, target, models):
        """Calculate the uncertainty.
        target: unlabel_martix
        """
        Uncertainty = np.zeros([self.n_samples, self.n_classes])
        # unlabel_data = self.X[unlabel_index, :]
        for j in np.arange(self.n_classes):
            model = models[j]
            j_target = target[:, j]
            j_label = np.where(j_target != 1)
            j_unlabel = np.where(j_target == 1)
            for i in j_unlabel[0]:
                d_v = model.decision_function([self.X[i]])
                Uncertainty[i][j] = np.abs(1 / d_v)
            Uncertainty[j_label, j] = -np.infty
        return Uncertainty
def cal_uncertainty ( self , target , models ) : Uncertainty = np . zeros ( [ self . n_samples , self . n_classes ] ) # unlabel_data = self.X[unlabel_index, :] for j in np . arange ( self . n_classes ) : model = models [ j ] j_target = target [ : , j ] j_label = np . where ( j_target != 1 ) j_unlabel = np . where ( j_target == 1 ) for i in j_unlabel [ 0 ] : d_v = model . decision_function ( [ self . X [ i ] ] ) Uncertainty [ i ] [ j ] = np . abs ( 1 / d_v ) Uncertainty [ j_label , j ] = - np . infty return Uncertainty