9d0ed839dc9df4c9afc5966c1e3276c478a58d53,scripts/update_metadata_util.py,,load_task,#Any#,24

Before Change


    unique = np.unique(y_train)
    mapping = {unique_value: i for i, unique_value in enumerate(unique)}
    y_train = np.array([mapping[value] for value in y_train])
    y_test = np.array([mapping[value] for value in y_test])

    return X_train, y_train, X_test, y_test, cat

After Change


    del dataset
    cat = ["categorical" if c else "numerical" for c in cat]

    if isinstance(task, openml.tasks.OpenMLClassificationTask):
        task_type = "classification"
    elif isinstance(task, openml.tasks.OpenMLRegressionTask):
        task_type = "regression"
    else:
        raise ValueError("Unknown task type")

    return X_train, y_train, X_test, y_test, cat, task_type
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: automl/auto-sklearn
Commit Name: 9d0ed839dc9df4c9afc5966c1e3276c478a58d53
Time: 2020-09-16
Author: feurerm@informatik.uni-freiburg.de
File Name: scripts/update_metadata_util.py
Class Name:
Method Name: load_task


Project Name: scikit-learn-contrib/sklearn-pandas
Commit Name: 1c7a87e96c4b6180e423586193c26e5ccd2f6bfd
Time: 2015-08-02
Author: mahmoud@thehumangeo.com
File Name: sklearn_pandas/__init__.py
Class Name: DataFrameMapper
Method Name: transform


Project Name: tensorflow/datasets
Commit Name: 0522a7c3263652eb5c84590b30c1e1eeb987c3a3
Time: 2020-03-11
Author: ronw@google.com
File Name: tensorflow_datasets/core/features/audio_feature.py
Class Name: Audio
Method Name: encode_example


Project Name: scipy/scipy
Commit Name: 19a50bcafb6d6d47e33af36c2cd4375961f65b85
Time: 2013-08-09
Author: blake.a.griffith@gmail.com
File Name: scipy/sparse/tests/test_base.py
Class Name: _TestSlicing
Method Name: test_slicing_3