class_docstr: A dataset configuration for datasets obtained directly from Kaggle.
class_docstr_tok: ["A","dataset","configuration","for","datasets","obtained","directly","from","Kaggle","."]
code: def generate(self) -> None:
      # Check for the existence of the data
      if self.root.exists():
          return
  
      data_root = (
          Path.home() / ".mxnet" / "gluon-ts" / "datasets" / self.name()
      )
      if not data_root.exists():
          raise ValueError(
              f"download the dataset from Kaggle ({self._link}) and unzip it"
              f" into {data_root}"
          )
  
      # Extract the data and apply filters. The min length filter uses +3 as otherwise, catch22
      # features cannot be computed
      metadata, series = self._extract_data(data_root)
      filters = self._filters(metadata["prediction_length"]) + [
          MinLengthFilter(2 * metadata["prediction_length"] + 3)
      ]
      for f in filters:
          series = f(series)
  
      # Write everything to file
      test_dir = self.root / "gluonts" / "test"
      test_dir.mkdir(parents=True)
  
      with (self.root / "gluonts" / "metadata.json").open("w+") as f:
          json.dump(metadata, f)
  
      with (test_dir / "data.json").open("w+") as f:
          for item in series:
              json.dump(item, f)
              f.write("\n")
  
      # Create training and validation data
      read_transform_write(
          self.root / "gluonts" / "val" / "data.json",
          filters=[EndOfSeriesCutFilter(metadata["prediction_length"])],
          source=test_dir / "data.json",
      )
      read_transform_write(
          self.root / "gluonts" / "train" / "data.json",
          filters=[
              EndOfSeriesCutFilter(2 * metadata["prediction_length"])
          ],
          source=test_dir / "data.json",
      )
  
imports: import json
  import shutil
  import tempfile
  import urllib.request
  from dataclasses import dataclass
  from pathlib import Path
  from typing import Any, cast, Dict, List, Tuple
  from zipfile import ZipFile
  from gluonts.dataset.common import MetaData
  from gluonts.dataset.repository._tsf_datasets import Dataset
  from gluonts.dataset.repository._tsf_datasets import save_datasets, save_metadata
  from gluonts.dataset.repository._tsf_reader import TSFReader
  from gluonts.dataset.repository.datasets import materialize_dataset
  from tsbench.config.dataset.preprocessing.filters import AbsoluteValueFilter, ConstantTargetFilter, EndOfSeriesCutFilter, MinLengthFilter
  from ._base import DatasetConfig
  from .preprocessing import Filter, read_transform_write
label_desc: Use image node_id 1 for calling the KaggleDatasetConfig obj's underlying member method code with example usage: obj.generate() without return types