code: def test_nnEstimator_fit_nnmodel_transform(self):
      model = Sequential().add(Linear(2, 2))
      criterion = MSECriterion()
      estimator = (
          NNEstimator(
              model, criterion, SeqToTensor([2]), ArrayToTensor([2])
          )
          .setBatchSize(4)
          .setLearningRate(0.2)
          .setMaxEpoch(40)
      )
  
      df = self.get_estimator_df()
      nnModel = estimator.fit(df)
      assert nnModel.getBatchSize() == 4
  
      res = nnModel.transform(df)
      assert type(res).__name__ == "DataFrame"
      res.registerTempTable("nnModelDF")  # Compatible with spark 1.6
      results = self.sqlContext.table("nnModelDF")
  
      count = results.rdd.count()
      data = results.rdd.collect()
  
      for i in range(count):
          row_label = data[i][1]
          row_prediction = data[i][2]
          assert_allclose(
              row_label[0], row_prediction[0], atol=0, rtol=1e-1
          )
          assert_allclose(
              row_label[1], row_prediction[1], atol=0, rtol=1e-1
          )
  
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 11 for calling the TestNNClassifer obj's underlying member method code with example usage: obj.test_nnEstimator_fit_nnmodel_transform() without return types