Repository: keras-team/autokeras

Issue:
Task specific tuner for structured data classifier
### Feature Description

### Code Example
<!---
Please provide a code example for using that feature
given the proposed feature is implemented.
-->
```python
```

### Reason
<!---
Why do we need the feature?
-->

### Solution
<!---
Please tell us how to implement the feature,
if you have one in mind.
-->



Discussion:

Resolving patch:
diff --git a/autokeras/tasks/structured_data.py b/autokeras/tasks/structured_data.py
--- a/autokeras/tasks/structured_data.py
+++ b/autokeras/tasks/structured_data.py
@@ -27,6 +27,7 @@
 from autokeras.engine import tuner
 from autokeras.tasks.structured_data_mixin import StructuredDataMixin
 from autokeras.tuners import greedy
+from autokeras.tuners import task_specific
 from autokeras.utils import types
 
 
@@ -207,7 +208,7 @@ def __init__(
         **kwargs
     ):
         if tuner is None:
-            tuner = greedy.Greedy
+            tuner = task_specific.StructuredDataClassifierTuner
         super().__init__(
             outputs=blocks.ClassificationHead(
                 num_classes=num_classes,
diff --git a/autokeras/tuners/task_specific.py b/autokeras/tuners/task_specific.py
--- a/autokeras/tuners/task_specific.py
+++ b/autokeras/tuners/task_specific.py
@@ -115,6 +115,20 @@
     },
 ]
 
+STRUCTURED_DATA_CLASSIFIER = [
+    {
+        "structured_data_block_1/normalize": True,
+        "structured_data_block_1/dense_block_1/num_layers": 2,
+        "structured_data_block_1/dense_block_1/use_batchnorm": False,
+        "structured_data_block_1/dense_block_1/dropout": 0,
+        "structured_data_block_1/dense_block_1/units_0": 32,
+        "structured_data_block_1/dense_block_1/units_1": 32,
+        "classification_head_1/dropout": 0.0,
+        "optimizer": "adam",
+        "learning_rate": 0.001,
+    }
+]
+
 
 class ImageClassifierTuner(greedy.Greedy):
     def __init__(self, **kwargs):
@@ -124,3 +138,8 @@ def __init__(self, **kwargs):
 class TextClassifierTuner(greedy.Greedy):
     def __init__(self, **kwargs):
         super().__init__(initial_hps=TEXT_CLASSIFIER, **kwargs)
+
+
+class StructuredDataClassifierTuner(greedy.Greedy):
+    def __init__(self, **kwargs):
+        super().__init__(initial_hps=STRUCTURED_DATA_CLASSIFIER, **kwargs)


Test patch:
diff --git a/tests/autokeras/tuners/task_specific_test.py b/tests/autokeras/tuners/task_specific_test.py
--- a/tests/autokeras/tuners/task_specific_test.py
+++ b/tests/autokeras/tuners/task_specific_test.py
@@ -92,3 +92,20 @@ def test_txt_clf_init_hp1_equals_hp_of_a_model(clear_session, tmp_path):
     clf.tuner.hypermodel.build(hp)
 
     assert set(init_hp.keys()) == set(hp._hps.keys())
+
+
+def test_sd_clf_init_hp0_equals_hp_of_a_model(clear_session, tmp_path):
+    clf = ak.StructuredDataClassifier(
+        directory=tmp_path,
+        column_names=["a", "b"],
+        column_types={"a": "numerical", "b": "numerical"},
+    )
+    clf.inputs[0].shape = (2,)
+    clf.outputs[0].in_blocks[0].output_shape = (10,)
+    init_hp = task_specific.STRUCTURED_DATA_CLASSIFIER[0]
+    hp = kerastuner.HyperParameters()
+    hp.values = copy.copy(init_hp)
+
+    clf.tuner.hypermodel.build(hp)
+
+    assert set(init_hp.keys()) == set(hp._hps.keys())