code: def german_credit_numeric(
      train_fraction=1.0,
      normalize_fn=_normalize_zero_mean_one_std,
  ):
      """The numeric German Credit dataset [1].
  
      This dataset contains 1000 data points with 24 features and 1 binary label. It
      can be optionally split into a training and testing sets. The train set will
      contain `num_train_points = int(train_fraction * 1000)` examples and test set
      will contain `num_test_points = 1000 - num_train_points` examples.
  
      Args:
        train_fraction: What fraction of the data to put in the training set.
        normalize_fn: A callable to normalize the data. This should take the train
          and test features and return the normalized versions of them.
  
      Returns:
        dataset: A Dict with the following keys:
          `train_features`: Floating-point `Tensor` with shape `[num_train_points,
            24]`. Training features.
          `train_labels`: Integer `Tensor` with shape `[num_train_points]`. Training
            labels.
          `test_features`: Floating-point `Tensor` with shape `[num_test_points,
            24]`. Testing features.
          `test_labels`: Integer `Tensor` with shape `[num_test_points]`. Testing
            labels.
  
      #### References
  
      1. https://archive.ics.uci.edu/ml/datasets/statlog+(german+credit+data)
      """
      num_points = 1000
      num_train = int(num_points * train_fraction)
      num_test = num_points - num_train
      num_features = 24
  
      def load_dataset():
          """Function that actually loads the dataset."""
          if load_dataset.dataset is not None:
              return load_dataset.dataset
  
          with tf.name_scope("german_credit_numeric"), tf.init_scope():
              dataset = _tfds().load("german_credit_numeric:1.*.*")
              features = []
              labels = []
              for entry in _tfds().as_numpy(dataset)["train"]:
                  features.append(entry["features"])
                  # We're reversing the labels to match what's in the original dataset,
                  # rather the TFDS encoding.
                  labels.append(1 - entry["label"])
              features = np.stack(features, axis=0)
              labels = np.stack(labels, axis=0)
  
              train_features = features[:num_train]
              test_features = features[num_train:]
  
              if normalize_fn is not None:
                  train_features, test_features = normalize_fn(
                      train_features, test_features
                  )
  
              load_dataset.dataset = dict(
                  train_features=train_features,
                  train_labels=labels[:num_train].astype(np.int32),
                  test_features=test_features,
                  test_labels=labels[num_train:].astype(np.int32),
              )
  
          return load_dataset.dataset
  
      load_dataset.dataset = None
  
      return dict(
          train_features=_defer(
              lambda: load_dataset()["train_features"],
              shape=[num_train, num_features],
              dtype=np.float64,
          ),
          train_labels=_defer(
              lambda: load_dataset()["train_labels"],
              shape=[num_train],
              dtype=np.int32,
          ),
          test_features=_defer(
              lambda: load_dataset()["test_features"],
              shape=[num_test, num_features],
              dtype=np.float64,
          ),
          test_labels=_defer(
              lambda: load_dataset()["test_labels"],
              shape=[num_test],
              dtype=np.int32,
          ),
      )
  
imports: import numpy
  import tensorflow.compat.v2
  import tensorflow_probability
  from inference_gym.internal.datasets import brownian_motion_missing_middle_observations
  from inference_gym.internal.datasets import convection_lorenz_bridge
  from inference_gym.internal.datasets import sp500_closing_prices
  from inference_gym.internal.datasets import synthetic_item_response_theory
  from inference_gym.internal.datasets import synthetic_log_gaussian_cox_process
  from inference_gym.internal.datasets import synthetic_plasma_spectroscopy
  from inference_gym.internal.datasets import synthetic_plasma_spectroscopy_with_bump
label_desc: Use image node_id 6 for calling a global function with example usage: german_credit_numeric(train_fraction, normalize_fn) and returns: dict, load_dataset, load_dataset