class_docstr: Test class for regression tests.
code: def check_rescaling(self, name, grid_search=False):
      train_fs, test_fs, _ = make_regression_data(
          num_examples=2000, sd_noise=4, num_features=3
      )
  
      # instantiate the given learner and its rescaled counterpart
      learner = Learner(name)
      rescaled_learner = Learner(f"Rescaled{name}")
  
      # train both the regular regressor and the rescaled regressor
      # with and without using grid search
      if grid_search:
          learner.train(
              train_fs, grid_search=True, grid_objective="pearson"
          )
          rescaled_learner.train(
              train_fs, grid_search=True, grid_objective="pearson"
          )
      else:
          learner.train(train_fs, grid_search=False)
          rescaled_learner.train(train_fs, grid_search=False)
  
      # now generate both sets of predictions on the test feature set
      predictions = learner.predict(test_fs)
      rescaled_predictions = rescaled_learner.predict(test_fs)
  
      # ... and on the training feature set
      train_predictions = learner.predict(train_fs)
      rescaled_train_predictions = rescaled_learner.predict(train_fs)
  
      # make sure that both sets of correlations are close to perfectly
      # correlated, since the only thing different is that one set has been
      # rescaled
      self.assertAlmostEqual(
          pearsonr(predictions, rescaled_predictions)[0], 1.0, places=3
      )
  
      # make sure that the standard deviation of the rescaled test set
      # predictions is higher than the standard deviation of the regular test set
      # predictions
      p_std = np.std(predictions)
      rescaled_p_std = np.std(rescaled_predictions)
      self.assertGreater(rescaled_p_std, p_std)
  
      # make sure that the standard deviation of the rescaled predictions
      # on the TRAINING set (not the TEST) is closer to the standard
      # deviation of the training set labels than the standard deviation
      # of the regular predictions.
      train_y_std = np.std(train_fs.labels)
      train_p_std = np.std(train_predictions)
      rescaled_train_p_std = np.std(rescaled_train_predictions)
      self.assertLess(
          abs(rescaled_train_p_std - train_y_std),
          abs(train_p_std - train_y_std),
      )
  
imports: import math
  import re
  import unittest
  import warnings
  from itertools import chain, product
  import numpy
  from numpy.testing import assert_allclose, assert_array_equal
  from scipy.stats import pearsonr
  from sklearn.exceptions import ConvergenceWarning
  from sklearn.linear_model import LinearRegression, LogisticRegression
  from skll.config import _setup_config_parser
  from skll.data import FeatureSet, NDJReader, NDJWriter
  from skll.experiments import run_configuration
  from skll.learner import Learner
  from skll.learner.utils import rescaled
  from skll.utils.constants import CLASSIFICATION_ONLY_METRICS
  from skll.utils.testing import config_dir, fill_in_config_paths_for_fancy_output, make_regression_data, other_dir, output_dir, test_dir, train_dir, unlink
label_desc: Use image node_id 3 for calling the TestRegression obj's underlying member method code with example usage: obj.check_rescaling(name, grid_search) without return types