code: def _get_pre_features(x):
      df = pd.DataFrame(x.numpy())
      df = df.rename(
          columns={
              0: "mean",
              1: "var",
              2: "week_id",
              3: "month_id",
          }
      )
      df["mean"] = (df["mean"] - df["mean"].min()) / (
          df["mean"].max() - df["mean"].min()
      )
      df["var"] = (df["var"] - df["var"].min()) / (
          df["var"].max() - df["var"].min()
      )
      df = pd.get_dummies(
          df, columns=["week_id", "month_id"], dummy_na=True
      )
      return torch.from_numpy(df.to_numpy())
  
file_path: gluonts/src/gluonts/nursery/SCott/dataset_tools/algo_clustering.py
imports: from pts.dataset.repository.datasets import get_dataset, dataset_recipes
  from pts.dataset.utils import to_pandas
  import numpy
  import pandas
  from pts.dataset import ListDataset
  import torch
  from pts.model.simple_feedforward import SimpleFeedForwardEstimator
  import pickle
  import json
  import random
  import time
  from matplotlib import pyplot
  from pykeops.torch import LazyTensor
label_desc: Use image node_id 2 for calling a global function with example usage: _get_pre_features(x) and returns: torch