(path)
return ret_arr[0], ret_arr[1], ret_arr[2], ret_arr[3]
Load split from path.

    Parameters
    ----------
    path: str
        Path to a dir which contains train_idx.txt, test_idx.txt, label_idx.txt, unlabel_idx.txt.

    Returns
    -------
    train_idx: list
        index of training set, shape like [n_split_count, n_training_samples]

    test_idx: list
        index of testing set, shape like [n_split_count, n_testing_samples]

    label_idx: list
        index of labeling set, shape like [n_split_count, n_labeling_samples]

    unlabel_idx: list
        index of unlabeling set, shape like [n_split_count, n_unlabeling_samples]
Load split from path.
Load split from path .
def split_load(path):
    """Load split from path.

    Parameters
    ----------
    path: str
        Path to a dir which contains train_idx.txt, test_idx.txt, label_idx.txt, unlabel_idx.txt.

    Returns
    -------
    train_idx: list
        index of training set, shape like [n_split_count, n_training_samples]

    test_idx: list
        index of testing set, shape like [n_split_count, n_testing_samples]

    label_idx: list
        index of labeling set, shape like [n_split_count, n_labeling_samples]

    unlabel_idx: list
        index of unlabeling set, shape like [n_split_count, n_unlabeling_samples]
    """
    if not isinstance(path, str):
        raise TypeError("A string is expected, but received: %s" % str(type(path)))
    saving_path = os.path.abspath(path)
    if not os.path.isdir(saving_path):
        raise Exception("A path to a directory is expected.")

    ret_arr = []
    for fname in ['train_idx.txt', 'test_idx.txt', 'label_idx.txt', 'unlabel_idx.txt']:
        if not os.path.exists(os.path.join(saving_path, fname)):
            if os.path.exists(os.path.join(saving_path, fname.split()[0] + '.npy')):
                ret_arr.append(np.load(os.path.join(saving_path, fname.split()[0] + '.npy')))
            else:
                ret_arr.append(None)
        else:
            ret_arr.append(np.loadtxt(os.path.join(saving_path, fname), dtype=int))
    return ret_arr[0], ret_arr[1], ret_arr[2], ret_arr[3]
def split_load ( path ) : if not isinstance ( path , str ) : raise TypeError ( "A string is expected, but received: %s" % str ( type ( path ) ) ) saving_path = os . path . abspath ( path ) if not os . path . isdir ( saving_path ) : raise Exception ( "A path to a directory is expected." ) ret_arr = [ ] for fname in [ 'train_idx.txt' , 'test_idx.txt' , 'label_idx.txt' , 'unlabel_idx.txt' ] : if not os . path . exists ( os . path . join ( saving_path , fname ) ) : if os . path . exists ( os . path . join ( saving_path , fname . split ( ) [ 0 ] + '.npy' ) ) : ret_arr . append ( np . load ( os . path . join ( saving_path , fname . split ( ) [ 0 ] + '.npy' ) ) ) else : ret_arr . append ( None ) else : ret_arr . append ( np . loadtxt ( os . path . join ( saving_path , fname ) , dtype = int ) ) return ret_arr [ 0 ] , ret_arr [ 1 ] , ret_arr [ 2 ] , ret_arr [ 3 ]