cd93c5446a236ed76456b188579e671d0619f333,scanpy/preprocessing/simple.py,,subsample,#Any#Any#Any#Any#,612

Before Change


    from .. import utils
    if not isinstance(data, AnnData):
        X = data
        return utils.subsample(X, subsample, seed)
    adata = data.copy() if copy else data
    _, smp_indices = utils.subsample(adata.X, subsample, seed)
    adata.inplace_subset_smp(smp_indices)
    for k in adata.smp_keys():

After Change


    Returns X, smp_indices if data is array-like, otherwise subsamples the passed
    AnnData (copy == False) or a copy of it (copy == True).
    
    if fraction > 1 or fraction < 0:
        raise ValueError("`fraction` needs to be within [0, 1], not {}"
                         .format(fraction))
    np.random.seed(seed)
    if isinstance(data, AnnData):
        adata = data.copy() if copy else data
        new_n_smps = int(fraction * adata.n_smps)
        logg.m("... subsampled to {} data points".format(new_n_smps), v=4)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: theislab/scanpy
Commit Name: cd93c5446a236ed76456b188579e671d0619f333
Time: 2017-07-21
Author: f.alex.wolf@gmx.de
File Name: scanpy/preprocessing/simple.py
Class Name:
Method Name: subsample


Project Name: automl/HPOlib2
Commit Name: 69cc2e937898715cb447b9ddcd40eccd929092b3
Time: 2020-08-28
Author: muller-phil@gmx.net
File Name: hpolib/container/client_abstract_benchmark.py
Class Name: AbstractBenchmarkClient
Method Name: get_fidelity_space


Project Name: automl/HPOlib2
Commit Name: 8368a4dc8513cebfb81eb8f931e6e11d7d17d26b
Time: 2020-08-26
Author: muller-phil@gmx.net
File Name: hpolib/container/client_abstract_benchmark.py
Class Name: AbstractBenchmarkClient
Method Name: get_configuration_space