2ab1119596b420cc696a783271d617562ccf7e28,cesium/tests/fixtures.py,,sample_featureset,#Any#Any#Any#Any#Any#Any#,42

Before Change


    feat_dict = {f: (["channel", "name"], [np.random.random(size)
                                           for i in range(n_channels)])
                 for f in features}
    fset = xr.Dataset(feat_dict)
    fset.coords["name"] = ts_names
    fset.coords["channel"] = range(n_channels)
    if targets:
        ts_targets = np.array(list(islice(cycle(targets), size)))
        fset.coords["target"] = ("name", ts_targets)
    if names:
        fset.name.values = names 
    for feat in meta_features:
        fset[feat] = ("name", np.random.random(size))

    return Featureset(fset)

After Change


    ts_names = np.arange(size).astype("str")
    index = pd.MultiIndex.from_tuples([(f, i) for f in features for i in range(n_channels)],
                                      names=["feature", "channel"])
    fset = pd.DataFrame(np.random.random((size, len(features) * n_channels)),
                        columns=index)
    if targets:
        targets = np.array(list(islice(cycle(targets), size)))
    if names:
        fset.index = names
    for feat in meta_features:
        fset[feat] = np.random.random(size)

    return fset, targets
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: cesium-ml/cesium
Commit Name: 2ab1119596b420cc696a783271d617562ccf7e28
Time: 2017-03-29
Author: brettnaul@gmail.com
File Name: cesium/tests/fixtures.py
Class Name:
Method Name: sample_featureset


Project Name: PyMVPA/PyMVPA
Commit Name: fe3b6dd853004ad7a05a253003f5eafd28d4d8d5
Time: 2010-01-04
Author: michael.hanke@gmail.com
File Name: mvpa/measures/anova.py
Class Name: CompoundOneWayAnova
Method Name: _call


Project Name: ntucllab/libact
Commit Name: f497ac84d909cffd80d0d6b9c9166b65633c3711
Time: 2019-06-30
Author: eugene2528@gmail.com
File Name: libact/query_strategies/query_by_committee.py
Class Name: QueryByCommittee
Method Name: _labeled_uniform_sample


Project Name: ntucllab/libact
Commit Name: dd7c0adc26050d75334bd9ab1885d9d40f9a0113
Time: 2015-05-13
Author: lsc36x@gmail.com
File Name: libact/base/dataset.py
Class Name: Dataset
Method Name: labeled_uniform_sample