code: def make_regression_data(
      num_examples=100,
      train_test_ratio=0.5,
      num_features=2,
      sd_noise=1.0,
      use_feature_hashing=False,
      feature_bins=4,
      start_feature_num=1,
      random_state=1234567890,
  ):
      """
      Create dummy regression data for use with tests.
  
      Parameters
      ----------
      num_examples : int, optional
          Number of examples in the generated data.
          Defaults to 100.
      train_test_ratio : float, optional
          Ratio of train to test data in the generated data.
          Defaults to 0.5.
      num_features : int, optional
          Number of features in each generated example.
          Defaults to 2.
      sd_noise : float, optional
          Amount of Gaussian noise added to the output.
          Defaults to 1.0.
      use_feature_hashing : bool, optional
          Whether to use feature hashing.
          Defaults to ``False``.
      feature_bins : int, optional
          How many hashed feature bins to use, if ``use_feature_hashing``
          is ``True``.
          Defaults to 4.
      start_feature_num : int, optional
          The integer suffix for the first feature name (i.e., "f01").
          Defaults to 1.
      random_state : int, optional
          Random state to use for generating the data.
          Defaults to 123456789.
  
      Returns
      -------
      Tuple
          3-tuple containing the generated training featureset, the generated
          test featureset, and a dictionary containing the oracle feature
          weights
      """
      # if we are doing feature hashing and we have asked for more
      # feature bins than number of total features, we need to
      # handle that because `make_regression()` doesn't know
      # about hashing
      if use_feature_hashing and num_features < feature_bins:
          num_features = feature_bins
  
      # use sklearn's make_regression to generate the data for us
      X, y, weights = make_regression(
          n_samples=num_examples,
          n_features=num_features,
          noise=sd_noise,
          random_state=random_state,
          coef=True,
      )
  
      # since we want to use SKLL's FeatureSet class, we need to
      # create a list of IDs
      ids = [f"EXAMPLE_{n}" for n in range(1, num_examples + 1)]
  
      # create a list of dictionaries as the features
      index_width_for_feature_name = int(floor(log10(num_features))) + 1
      feature_names = []
      for n in range(
          start_feature_num, start_feature_num + num_features
      ):
          index_str = str(n).zfill(index_width_for_feature_name)
          feature_name = f"f{index_str}"
          feature_names.append(feature_name)
      features = [dict(zip(feature_names, row)) for row in X]
  
      # At this point the labels are generated using unhashed features
      # even if we want to do feature hashing. `make_regression()` from
      # sklearn doesn't know anything about feature hashing, so we need
      # a hack here to compute the updated labels ourselves
      # using the same command that sklearn uses inside `make_regression()`
      # which is to generate the X and the weights and then compute the
      # y as the dot product of the two. This y will then be used as our
      # labels instead of the original y we got from `make_regression()`.
      # Note that we only want to use the number of weights that are
      # equal to the number of feature bins for the hashing
      if use_feature_hashing:
          feature_hasher = FeatureHasher(n_features=feature_bins)
          hashed_X = feature_hasher.fit_transform(features)
          y = hashed_X.dot(weights[:feature_bins])
  
      # convert the weights array into a dictionary for convenience
      # if we are using feature hashing, we need to use the names
      # that would be output by `model_params()` instead of the
      # original names since that's what we would get from SKLL
      if use_feature_hashing:
          index_width_for_feature_name = (
              int(floor(log10(feature_bins))) + 1
          )
          hashed_feature_names = []
          for i in range(feature_bins):
              index_str = str(i + 1).zfill(index_width_for_feature_name)
              feature_name = f"hashed_feature_{index_str}"
              hashed_feature_names.append(feature_name)
          weightdict = dict(
              zip(hashed_feature_names, weights[:feature_bins])
          )
      else:
          weightdict = dict(zip(feature_names, weights))
  
      # split everything into training and testing portions
      num_train_examples = int(round(train_test_ratio * num_examples))
      train_features, test_features = (
          features[:num_train_examples],
          features[num_train_examples:],
      )
      train_y, test_y = y[:num_train_examples], y[num_train_examples:]
      train_ids, test_ids = (
          ids[:num_train_examples],
          ids[num_train_examples:],
      )
  
      # create a FeatureHasher if we are asked to use feature hashing
      # with the specified number of feature bins
      vectorizer = (
          FeatureHasher(n_features=feature_bins)
          if use_feature_hashing
          else None
      )
      train_fs = FeatureSet(
          "regression_train",
          train_ids,
          labels=train_y,
          features=train_features,
          vectorizer=vectorizer,
      )
      test_fs = FeatureSet(
          "regression_test",
          test_ids,
          labels=test_y,
          features=test_features,
          vectorizer=vectorizer,
      )
  
      return (train_fs, test_fs, weightdict)
  
imports: import os
  import re
  from collections import OrderedDict
  from math import floor, log10
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Tuple
  import numpy
  from numpy.random import RandomState
  from sklearn.datasets import fetch_california_housing, load_digits, make_classification, make_regression
  from sklearn.feature_extraction import FeatureHasher
  from sklearn.model_selection import KFold, ShuffleSplit, StratifiedKFold
  from sklearn.utils import shuffle
  from skll.config import _setup_config_parser, fix_json
  from skll.data import FeatureSet, NDJWriter
  from skll.types import PathOrStr
label_desc: Use image node_id 10 for calling a global function with example usage: make_regression_data(num_examples, train_test_ratio, num_features, sd_noise, use_feature_hashing, feature_bins, start_feature_num, random_state) and returns: train_fs,  test_fs,  weightdict