15f09fbeb534cb7b68cf1c928ea6ced85f606de3,mltsp/featurize_tools.py,,featurize_single_ts,#Any#Any#Any#Any#Any#Any#,16

Before Change


        e = np.reshape(m, (-1, 1))
    // These lists are assembled separately in case any custom features have the
    // same name as an MLTSP feature, in which case we use the custom features
    obs_feature_lists = {}
    science_feature_lists = {}
    custom_feature_lists = {}
    for i in range(m.shape[1]): // featurize each channel
        obs_features = oft.generate_obs_features(t, m[:,i], e[:,i], features_to_use)
        science_features = sft.generate_science_features(t, m[:,i], e[:,i],
                                                         features_to_use)
        if custom_script_path:
            custom_features = cft.generate_custom_features(custom_script_path,
                t, m[:,i], e[:,i], features_already_known=dict(
                list(obs_features.items()) + list(science_features.items()) + 
                list(meta_features.items())))
            custom_features = {key: custom_features[key] for key in
                               custom_features.keys() if key in features_to_use}
        else:
            custom_features = {}

        for feature, value in obs_features.items():
            obs_feature_lists.get(feature, []).append(value)
        for feature, value in science_features.items():
            science_feature_lists.get(feature, []).append(value)
        for feature, value in custom_features.items():
            custom_feature_lists.get(feature, []).append(value)

    all_feature_lists = obs_feature_lists
    all_feature_lists.update(science_feature_lists)
    all_feature_lists.update(custom_feature_lists)
    return all_feature_lists


def assemble_featureset(feature_dicts, targets=None, metadata=None, names=None):

After Change



        // We set values in this order so that custom features take priority
        // over MLTSP features in the case of name conflicts
        for feature, value in (list(obs_features.items()) +
                               list(science_features.items()) +
                               list(custom_features.items())):
            all_feature_lists[feature][i] = value

    return all_feature_lists


def assemble_featureset(feature_dicts, targets=None, metadata=None, names=None):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: cesium-ml/cesium
Commit Name: 15f09fbeb534cb7b68cf1c928ea6ced85f606de3
Time: 2015-11-12
Author: brettnaul@gmail.com
File Name: mltsp/featurize_tools.py
Class Name:
Method Name: featurize_single_ts


Project Name: snorkel-team/snorkel
Commit Name: 19ae606b4608957335ce16b8bd2a9bd2ecd7e098
Time: 2016-07-01
Author: ajratner@gmail.com
File Name: tutorial/load_dictionaries.py
Class Name:
Method Name: load_acronym_dictionary


Project Name: biolab/orange3
Commit Name: 0df515fe240365bfe130f94629f2c0c8a6286218
Time: 2017-08-18
Author: janez.demsar@fri.uni-lj.si
File Name: Orange/widgets/data/owpythonscript.py
Class Name: OWPythonScript
Method Name: initial_locals_state