(self, observed_mask, **kwargs)
return [(selected_feature // mc_sh[1], selected_feature % mc_sh[1])]
Select a subset from the unlabeled set by providing the mask matrix, 
        return the selected instance and feature.

        Parameters
        ----------
        observed_mask: {list, np.ndarray}
            The mask matrix of training set. the matrix should have the shape [n_train_idx, n_features].
            There must be only 1 and 0 in the matrix, in which, 1 means the corresponding element is known,
            otherwise, it will be cheated as an unknown element.

        Returns
        -------
        selected_feature: list
            The selected features, it is a list of tuples.
            Note that, the index is for the given mask, NOT the whole dataset.
Select a subset from the unlabeled set by providing the mask matrix, 
        return the selected instance and feature.
Select a subset from the unlabeled set by providing the mask matrix return the selected instance and feature .
def select_by_mask(self, observed_mask, **kwargs):
        """Select a subset from the unlabeled set by providing the mask matrix, 
        return the selected instance and feature.

        Parameters
        ----------
        observed_mask: {list, np.ndarray}
            The mask matrix of training set. the matrix should have the shape [n_train_idx, n_features].
            There must be only 1 and 0 in the matrix, in which, 1 means the corresponding element is known,
            otherwise, it will be cheated as an unknown element.

        Returns
        -------
        selected_feature: list
            The selected features, it is a list of tuples.
            Note that, the index is for the given mask, NOT the whole dataset.
        """
        if self._train_idx is None:
            raise ValueError("Please pass the indexes of training data when initializing.")
        observed_mask = np.asarray(observed_mask)
        assert len(observed_mask.shape) == 2
        assert observed_mask.shape[0] == len(self._train_idx)
        assert observed_mask.shape[1] == self.X.shape[1]

        X_mc = AFASMC_mask_mc(X=self.X[self._train_idx], y=self.y[self._train_idx], mask=observed_mask,
                              check_para=False, **kwargs)
        self._feature_variance.append(X_mc)
        mc_sh = np.shape(X_mc)
        if len(self._feature_variance) >= 2:
            var_mat = np.zeros(mc_sh)
            for i in range(mc_sh[0]):
                for j in range(mc_sh[1]):
                    var_mat[i, j] = np.var([mat[i][j] for mat in self._feature_variance])
            var_mat *= 1 - observed_mask
            # in the first 2 rounds, all entries are 0, you will select the known elements.
            selected_feature = np.argmax(var_mat)  # a 1d index in training set
        else:
            selected_feature = np.argmax(1 - observed_mask)

        return [(selected_feature // mc_sh[1], selected_feature % mc_sh[1])]
def select_by_mask ( self , observed_mask , * * kwargs ) : if self . _train_idx is None : raise ValueError ( "Please pass the indexes of training data when initializing." ) observed_mask = np . asarray ( observed_mask ) assert len ( observed_mask . shape ) == 2 assert observed_mask . shape [ 0 ] == len ( self . _train_idx ) assert observed_mask . shape [ 1 ] == self . X . shape [ 1 ] X_mc = AFASMC_mask_mc ( X = self . X [ self . _train_idx ] , y = self . y [ self . _train_idx ] , mask = observed_mask , check_para = False , * * kwargs ) self . _feature_variance . append ( X_mc ) mc_sh = np . shape ( X_mc ) if len ( self . _feature_variance ) >= 2 : var_mat = np . zeros ( mc_sh ) for i in range ( mc_sh [ 0 ] ) : for j in range ( mc_sh [ 1 ] ) : var_mat [ i , j ] = np . var ( [ mat [ i ] [ j ] for mat in self . _feature_variance ] ) var_mat *= 1 - observed_mask # in the first 2 rounds, all entries are 0, you will select the known elements. selected_feature = np . argmax ( var_mat ) # a 1d index in training set else : selected_feature = np . argmax ( 1 - observed_mask ) return [ ( selected_feature // mc_sh [ 1 ] , selected_feature % mc_sh [ 1 ] ) ]