e4a5dbe7e29d64c9b095d134f0ca2a5543353dda,autokeras/hypermodel/base.py,Head,transform,#Head#Any#,179

Before Change


    def transform(self, y):
        Transform y into a compatible type (tf.data.Dataset).
        self.check_data_type(y)
        if isinstance(y, tf.data.Dataset):
            return y
        if isinstance(y, np.ndarray):
            if len(y.shape) == 1:
                y = y.reshape(-1, 1)
            return tf.data.Dataset.from_tensor_slices(y)
        if isinstance(y, pd.DataFrame):
            return tf.data.Dataset.from_tensor_slices(y.values)
        if isinstance(y, pd.Series):
            return tf.data.Dataset.from_tensor_slices(y.values.reshape(-1, 1))

    def postprocess(self, y):

After Change


    def transform(self, y):
        Transform y into a compatible type (tf.data.Dataset).
        self._check(y)
        dataset = self._convert_to_dataset(y)
        return dataset

    def _convert_to_dataset(self, y):
        if isinstance(y, tf.data.Dataset):
            return y
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 8

Instances


Project Name: keras-team/autokeras
Commit Name: e4a5dbe7e29d64c9b095d134f0ca2a5543353dda
Time: 2019-10-20
Author: jhfjhfj1@gmail.com
File Name: autokeras/hypermodel/base.py
Class Name: Head
Method Name: transform


Project Name: ray-project/ray
Commit Name: 1775e89f262111791fabfd40f80a24f74738fe54
Time: 2020-04-28
Author: sven@anyscale.io
File Name: rllib/policy/policy.py
Class Name:
Method Name: clip_action


Project Name: keras-team/autokeras
Commit Name: e87e84a21e0dfc1258b2f868532b03fabfd66a85
Time: 2020-06-01
Author: jhfjhfj1@gmail.com
File Name: autokeras/engine/adapter.py
Class Name: Adapter
Method Name: convert_to_dataset


Project Name: keras-team/keras
Commit Name: 1dc67f374cde47a721e5fe5d9237bc2573bda2f0
Time: 2017-07-06
Author: souptc@gmail.com
File Name: keras/backend/cntk_backend.py
Class Name:
Method Name: in_train_phase