Repository: keras-team/autokeras

Issue:
Exception in multi label classification with StructuredDataClassifier
### Bug Description
Multi label classification throws the following error when using `StructuredDataClassifier`:

```
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-23-e7c45e9f8b2f> in <module>
----> 1 clf.predict(X)

/opt/conda/lib/python3.7/site-packages/autokeras/tasks/structured_data.py in predict(self, x, batch_size, **kwargs)
    156         x = self.read_for_predict(x)
    157 
--> 158         return super().predict(x=x, batch_size=batch_size, **kwargs)
    159 
    160     def evaluate(self, x, y=None, batch_size=32, **kwargs):

/opt/conda/lib/python3.7/site-packages/autokeras/auto_model.py in predict(self, x, **kwargs)
    421         self._check_data_format((x, None), predict=True)
    422         dataset = self._adapt(x, self.inputs)
--> 423         pipeline = self.tuner.get_best_pipeline()
    424         model = self.tuner.get_best_model()
    425         dataset = pipeline.transform_x(dataset)

/opt/conda/lib/python3.7/site-packages/autokeras/engine/tuner.py in get_best_pipeline(self)
     65 
     66     def get_best_pipeline(self):
---> 67         return pipeline_module.load_pipeline(self.best_pipeline_path)
     68 
     69     def _pipeline_path(self, trial_id):

/opt/conda/lib/python3.7/site-packages/autokeras/pipeline.py in load_pipeline(filepath, custom_objects)
     73         custom_objects = {}
     74     with tf.keras.utils.custom_object_scope(custom_objects):
---> 75         return Pipeline.from_config(utils.load_json(filepath))
     76 
     77 

/opt/conda/lib/python3.7/site-packages/autokeras/pipeline.py in from_config(cls, config)
    180                     for preprocessor in preprocessors
    181                 ]
--> 182                 for preprocessors in config["outputs"]
    183             ],
    184         )

/opt/conda/lib/python3.7/site-packages/autokeras/pipeline.py in <listcomp>(.0)
    180                     for preprocessor in preprocessors
    181                 ]
--> 182                 for preprocessors in config["outputs"]
    183             ],
    184         )

/opt/conda/lib/python3.7/site-packages/autokeras/pipeline.py in <listcomp>(.0)
    178                 [
    179                     preprocessors_module.deserialize(preprocessor)
--> 180                     for preprocessor in preprocessors
    181                 ]
    182                 for preprocessors in config["outputs"]

/opt/conda/lib/python3.7/site-packages/autokeras/preprocessors/__init__.py in deserialize(config, custom_objects)
     33         module_objects=globals(),
     34         custom_objects=custom_objects,
---> 35         printable_module_name="preprocessors",
     36     )

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name)
    358                 list(custom_objects.items())))
    359       with CustomObjectScope(custom_objects):
--> 360         return cls.from_config(cls_config)
    361     else:
    362       # Then `cls` may be a function returning a class.

/opt/conda/lib/python3.7/site-packages/autokeras/engine/serializable.py in from_config(cls, config)
     32             config: Dict. The config of the object.
     33         """
---> 34         return cls(**config)

/opt/conda/lib/python3.7/site-packages/autokeras/preprocessors/encoders.py in __init__(self, **kwargs)
    125 
    126     def __init__(self, **kwargs):
--> 127         super().__init__(labels=[], **kwargs)
    128 
    129     def transform(self, dataset):

TypeError: __init__() got multiple values for keyword argument 'labels'
```

### Bug Reproduction
Code for reproducing the bug:

```
from sklearn.datasets import make_multilabel_classification
import autokeras as ak

X, y = make_multilabel_classification(n_samples=1000, n_features=20, n_classes=2, n_labels=5)
clf = ak.StructuredDataClassifier(
    overwrite=True,
    max_trials=3,
    multi_label=True,
    objective='val_loss',
    loss='binary_crossentropy'
)
clf.fit(X, y, epochs=3)
clf.predict(X)
```

### Expected Behavior
This should not throw an error, but return the predictions of the multi label classification

### Setup Details
Include the details about the versions of:
 - OS type and version: Ubuntu 18.04.4
 - Python: 3.7.6
 - autokeras: 1.0.9
 - keras-tuner: 1.0.2rc2
 - scikit-learn: 0.23.2
 - numpy: 1.18.5
 - pandas: 1.1.2
 - tensorflow: 2.3.0



Discussion:

Resolving patch:
diff --git a/autokeras/preprocessors/encoders.py b/autokeras/preprocessors/encoders.py
--- a/autokeras/preprocessors/encoders.py
+++ b/autokeras/preprocessors/encoders.py
@@ -124,6 +124,7 @@ class MultiLabelEncoder(Encoder):
     """Encoder for multi-label data."""
 
     def __init__(self, **kwargs):
+        kwargs.pop("labels", None)
         super().__init__(labels=[], **kwargs)
 
     def transform(self, dataset):


Test patch: