cf85de326f75745d261b14033c031a32972ae020,autokeras/encoders.py,LabelEncoder,fit,#LabelEncoder#Any#,120

Before Change


            data: numpy.ndarray. The original labels.
        
        data = np.array(data).flatten()
        self._labels = set(data)
        if not self.num_classes:
            self.num_classes = len(self._labels)
        if self.num_classes < len(self._labels):
            raise ValueError("More classes in data than specified.")
        for index, label in enumerate(self._labels):
            self._int_to_label[index] = label
            self._label_to_int[label] = index

After Change


        self._labels = set(data)
        if not self.num_classes:
            self.num_classes = len(self._labels)
        self._check_num_classes()
        for index, label in enumerate(self._labels):
            self._int_to_label[index] = label
            self._label_to_int[label] = index
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 12

Instances


Project Name: jhfjhfj1/autokeras
Commit Name: cf85de326f75745d261b14033c031a32972ae020
Time: 2020-08-03
Author: jin@tamu.edu
File Name: autokeras/encoders.py
Class Name: LabelEncoder
Method Name: fit


Project Name: keras-team/autokeras
Commit Name: cf85de326f75745d261b14033c031a32972ae020
Time: 2020-08-03
Author: jin@tamu.edu
File Name: autokeras/encoders.py
Class Name: LabelEncoder
Method Name: fit


Project Name: jhfjhfj1/autokeras
Commit Name: cf85de326f75745d261b14033c031a32972ae020
Time: 2020-08-03
Author: jin@tamu.edu
File Name: autokeras/encoders.py
Class Name: OneHotEncoder
Method Name: fit