(X, y, omega, **kwargs)
return AFASMC_mask_mc(X=X, y=y, mask=obrT, check_para=False, **kwargs)
Perform matrix completion method in AFASMC.
    It will train a linear model to use the label information.

    Parameters
    ----------
    X: array
        The [n_samples, n_features] training matrix in which X_ij indicates j-th
        feature of i-th instance. The unobserved entries can be anything.

    y: array
        The The [n_samples] label vector.

    omega: {list, MultiLabelIndexCollection, numpy.ndarray}
        The indices for the observed entries of X.
        Should be a 1d array of indexes (in matlab way),
        or MultiLabelIndexCollection or a list
        of tuples with 2 elements, in which, the 1st element is the index of instance
        and the 2nd element is the index of label.

    kwargs:
        lambda1  : The lambda1 trade-off parameter
        lambda2  : The lambda2 trade-off parameter
        max_in_iter : The maximal iterations of inner optimization
        max_out_iter : The maximal iterations of the outer optimization

    Returns
    -------
    Xmc: array
        The completed matrix.

    References
    ----------
    [1] Active feature acquisition with supervised matrix completion.
        Sheng-Jun Huang, Miao Xu, Ming-Kun Xie, Masashi Sugiyama, Gang Niu and Songcan Chen
        In: Proceedings of the 24th ACM SIGKDD Conference on Knowledge Discovery and Data
        Mining (KDD'18), 2018.
Perform matrix completion method in AFASMC.
    It will train a linear model to use the label information.
Perform matrix completion method in AFASMC . It will train a linear model to use the label information .
def AFASMC_mc(X, y, omega, **kwargs):
    """Perform matrix completion method in AFASMC.
    It will train a linear model to use the label information.

    Parameters
    ----------
    X: array
        The [n_samples, n_features] training matrix in which X_ij indicates j-th
        feature of i-th instance. The unobserved entries can be anything.

    y: array
        The The [n_samples] label vector.

    omega: {list, MultiLabelIndexCollection, numpy.ndarray}
        The indices for the observed entries of X.
        Should be a 1d array of indexes (in matlab way),
        or MultiLabelIndexCollection or a list
        of tuples with 2 elements, in which, the 1st element is the index of instance
        and the 2nd element is the index of label.

    kwargs:
        lambda1  : The lambda1 trade-off parameter
        lambda2  : The lambda2 trade-off parameter
        max_in_iter : The maximal iterations of inner optimization
        max_out_iter : The maximal iterations of the outer optimization

    Returns
    -------
    Xmc: array
        The completed matrix.

    References
    ----------
    [1] Active feature acquisition with supervised matrix completion.
        Sheng-Jun Huang, Miao Xu, Ming-Kun Xie, Masashi Sugiyama, Gang Niu and Songcan Chen
        In: Proceedings of the 24th ACM SIGKDD Conference on Knowledge Discovery and Data
        Mining (KDD'18), 2018.
    """
    n_samples, n_features = np.shape(X)

    # X_obr = np.zeros(n_samples * n_features)
    # X_obr[omega] = X.flatten(order='F')[omega]
    # X_obr = X_obr.reshape((n_features, n_samples)).T
    if not isinstance(omega, MultiLabelIndexCollection):
        try:
            if isinstance(omega[0], tuple):
                omega = MultiLabelIndexCollection(omega, n_features)
            else:
                omega = MultiLabelIndexCollection.construct_by_1d_array(omega, label_mat_shape=(n_samples, n_features))
        except:
            raise ValueError("Please pass a 1d array of indexes or MultiLabelIndexCollection "
                             "(column major, start from 0) or a list "
                             "of tuples with 2 elements, in which, the 1st element is the index of instance "
                             "and the 2nd element is the index of features.")

    obrT = omega.get_matrix_mask(mat_shape=(n_samples, n_features), sparse=False)

    return AFASMC_mask_mc(X=X, y=y, mask=obrT, check_para=False, **kwargs)
def AFASMC_mc ( X , y , omega , * * kwargs ) : n_samples , n_features = np . shape ( X ) # X_obr = np.zeros(n_samples * n_features) # X_obr[omega] = X.flatten(order='F')[omega] # X_obr = X_obr.reshape((n_features, n_samples)).T if not isinstance ( omega , MultiLabelIndexCollection ) : try : if isinstance ( omega [ 0 ] , tuple ) : omega = MultiLabelIndexCollection ( omega , n_features ) else : omega = MultiLabelIndexCollection . construct_by_1d_array ( omega , label_mat_shape = ( n_samples , n_features ) ) except : raise ValueError ( "Please pass a 1d array of indexes or MultiLabelIndexCollection " "(column major, start from 0) or a list " "of tuples with 2 elements, in which, the 1st element is the index of instance " "and the 2nd element is the index of features." ) obrT = omega . get_matrix_mask ( mat_shape = ( n_samples , n_features ) , sparse = False ) return AFASMC_mask_mc ( X = X , y = y , mask = obrT , check_para = False , * * kwargs )