code: def test_nnEstimator_fit_with_train_val_summary(self):
      model = Sequential().add(Linear(2, 2))
      criterion = MSECriterion()
      data = self.sc.parallelize(
          [
              ((2.0, 1.0), (1.0, 2.0)),
              ((1.0, 2.0), (2.0, 1.0)),
              ((2.0, 1.0), (1.0, 2.0)),
              ((1.0, 2.0), (2.0, 1.0)),
          ]
      )
      val_data = self.sc.parallelize(
          [((2.0, 1.0), (1.0, 2.0)), ((1.0, 2.0), (2.0, 1.0))]
      )
      schema = StructType(
          [
              StructField(
                  "features", ArrayType(DoubleType(), False), False
              ),
              StructField(
                  "label", ArrayType(DoubleType(), False), False
              ),
          ]
      )
      df = self.sqlContext.createDataFrame(data, schema)
      val_df = self.sqlContext.createDataFrame(val_data, schema)
  
      tmp_dir = tempfile.mkdtemp()
      train_summary = TrainSummary(log_dir=tmp_dir, app_name="estTest")
      train_summary.set_summary_trigger(
          "LearningRate", SeveralIteration(1)
      )
      val_summary = ValidationSummary(
          log_dir=tmp_dir, app_name="estTest"
      )
      estimator = (
          NNEstimator(
              model, criterion, SeqToTensor([2]), SeqToTensor([2])
          )
          .setBatchSize(4)
          .setMaxEpoch(5)
          .setTrainSummary(train_summary)
      )
      assert estimator.getValidation() is None
      estimator.setValidation(
          EveryEpoch(), val_df, [MAE()], 2
      ).setValidationSummary(val_summary)
      assert estimator.getValidation() is not None
  
      nnModel = estimator.fit(df)
      res = nnModel.transform(df)
      lr_result = train_summary.read_scalar("LearningRate")
      mae_result = val_summary.read_scalar("MAE")
      assert isinstance(estimator.getTrainSummary(), TrainSummary)
      assert type(res).__name__ == "DataFrame"
      assert len(lr_result) == 5
      assert len(mae_result) == 4
  
imports: import errno
  import shutil
  import pytest
  from bigdl.nn.criterion import *
  from bigdl.nn.layer import *
  from bigdl.optim.optimizer import *
  from numpy.testing import assert_allclose
  from pyspark.ml import Pipeline, PipelineModel
  from pyspark.ml.feature import MinMaxScaler
  from pyspark.ml.tuning import ParamGridBuilder
  from pyspark.sql.types import *
  from zoo.common.nncontext import *
  from zoo.feature.common import *
  from zoo.feature.image import *
  from zoo.pipeline.api.keras import layers
  from zoo.pipeline.api.keras.models import Model
  from zoo.pipeline.api.keras.optimizers import Adam
  from zoo.pipeline.nnframes import *
  from zoo.util.tf import *
label_desc: Use image node_id 18 for calling the TestNNClassifer obj's underlying member method code with example usage: obj.test_nnEstimator_fit_with_train_val_summary() without return types