code: def test_regression(self):
      trn, val, preproc = tabular.tabular_from_csv(
          "resources/tabular_data/adults.csv",
          label_columns=["age"],
          is_regression=True,
          random_state=42,
      )
      model = tabular.tabular_regression_model("mlp", trn)
      learner = ktrain.get_learner(
          model, train_data=trn, val_data=val, batch_size=128
      )
  
      lr = 0.001
      hist = learner.autofit(lr, 5)
  
      # test training results
      self.assertAlmostEqual(max(hist.history["lr"]), lr)
      self.assertLess(min(hist.history["val_mae"]), 8.0)
  
      # test top losses
      obs = learner.top_losses(n=1, val_data=val)
      self.assertIn(obs[0][0], list(range(val.df.shape[0])))
      learner.view_top_losses(preproc=preproc, n=1, val_data=val)
  
      # test weight decay
      self.assertEqual(learner.get_weight_decay(), None)
      learner.set_weight_decay(1e-2)
      self.assertAlmostEqual(learner.get_weight_decay(), 1e-2)
  
      # test load and save model
      learner.save_model("/tmp/test_model")
      learner.load_model("/tmp/test_model")
  
      # test validate
      cm = learner.evaluate(val)
  
      # test predictor
      p = ktrain.get_predictor(learner.model, preproc)
  
      train_df = pd.read_csv("resources/tabular_data/adults.csv")
      age = p.predict(train_df)[0][0]
      self.assertLess(age, 100)
      p.save("/tmp/test_predictor")
      p = ktrain.load_predictor("/tmp/test_predictor")
      self.assertAlmostEqual(p.predict(train_df)[0][0], age)
  
file_path: ktrain/tests/test_tabular.py
imports: from unittest import TestCase, main, skip
  import IPython
  import numpy
  import pandas
  import testenv
  import ktrain
  from ktrain import tabular
  from ktrain.imports import ACC_NAME, VAL_ACC_NAME
label_desc: Use image node_id 2 for calling the TestTabular obj's underlying member method code with example usage: obj.test_regression() without return types