class_docstr: Abstract base class for deep learning time series regression.
  
  The base classifier provides a deep learning default method for
  _predict, and provides a new abstract method for building a
  model.
  
  Parameters
  ----------
  batch_size : int, default = 40
      training batch size for the model
  
  Attributes
  ----------
  self.model_ - the fitted DL model
class_docstr_tok: ["Abstract","base","class","for","deep","learning","time","series","regression",".","The","base","classifier","provides","a","deep","learning","default","method","for","_predict",",","and","provides","a","new","abstract","method","for","building","a","model",".","Parameters","--","--","--","--","--","batch_size",":","int",",","default","=","40","training","batch","size","for","the","model","Attributes","--","--","--","--","--","self.model_","-","the","fitted","DL","model"]
docstr: Save serialized self to bytes-like object or to (.zip) file.
  
  Behaviour:
  if `path` is None, returns an in-memory serialized self
  if `path` is a file, stores the zip with that name at the location.
  The contents of the zip file are:
  _metadata - contains class of self, i.e., type(self).
  _obj - serialized self. This class uses the default serialization (pickle).
  keras/ - model, optimizer and state stored inside this directory.
  history - serialized history object.
  
  
  Parameters
  ----------
  path : None or file location (str or Path)
      if None, self is saved to an in-memory object
      if file location, self is saved to that file location. For eg:
          path="estimator" then a zip file `estimator.zip` will be made at cwd.
          path="/home/stored/estimator" then a zip file `estimator.zip` will be
          stored in `/home/stored/`.
  
  Returns
  -------
  if `path` is None - in-memory serialized self
  if `path` is file location - ZipFile with reference to the file
docstr_tok: ["Save","serialized","self","to","bytes-like","object","or","to","(",".zip",")","file",".","Behaviour",":","if","`","path","`","is","None",",","returns","an","in-memory","serialized","self","if","`","path","`","is","a","file",",","stores","the","zip","with","that","name","at","the","location",".","The","contents","of","the","zip","file","are",":","_metadata","-","contains","class","of","self",",","i.e.",",","type","(","self",")",".","_obj","-","serialized","self",".","This","class","uses","the","default","serialization","(","pickle",")",".","keras\/","-","model",",","optimizer","and","state","stored","inside","this","directory",".","history","-","serialized","history","object",".","Parameters","--","--","--","--","--","path",":","None","or","file","location","(","str","or","Path",")","if","None",",","self","is","saved","to","an","in-memory","object","if","file","location",",","self","is","saved","to","that","file","location",".","For","eg",":","path=","''","estimator","''","then","a","zip","file","`","estimator.zip","`","will","be","made","at","cwd",".","path=","''","\/home\/stored\/estimator","''","then","a","zip","file","`","estimator.zip","`","will","be","stored","in","`","\/home\/stored\/","`",".","Returns","--","--","--","-","if","`","path","`","is","None","-","in-memory","serialized","self","if","`","path","`","is","file","location","-","ZipFile","with","reference","to","the","file"]
code: def save(self, path=None):
      """Save serialized self to bytes-like object or to (.zip) file.
  
      Behaviour:
      if `path` is None, returns an in-memory serialized self
      if `path` is a file, stores the zip with that name at the location.
      The contents of the zip file are:
      _metadata - contains class of self, i.e., type(self).
      _obj - serialized self. This class uses the default serialization (pickle).
      keras/ - model, optimizer and state stored inside this directory.
      history - serialized history object.
  
  
      Parameters
      ----------
      path : None or file location (str or Path)
          if None, self is saved to an in-memory object
          if file location, self is saved to that file location. For eg:
              path="estimator" then a zip file `estimator.zip` will be made at cwd.
              path="/home/stored/estimator" then a zip file `estimator.zip` will be
              stored in `/home/stored/`.
  
      Returns
      -------
      if `path` is None - in-memory serialized self
      if `path` is file location - ZipFile with reference to the file
      """
      import pickle
      import shutil
      from pathlib import Path
      from zipfile import ZipFile
  
      if path is None:
          _check_soft_dependencies("h5py")
          import h5py
  
          in_memory_model = None
          if self.model_ is not None:
              with h5py.File(
                  "disk_less", "w", driver="core", backing_store=False
              ) as h5file:
                  self.model_.save(h5file)
                  h5file.flush()
                  in_memory_model = h5file.id.get_file_image()
  
          in_memory_history = pickle.dumps(self.history.history)
  
          return (
              type(self),
              (
                  pickle.dumps(self),
                  in_memory_model,
                  in_memory_history,
              ),
          )
  
      if not isinstance(path, (str, Path)):
          raise TypeError(
              "`path` is expected to either be a string or a Path object "
              f"but found of type:{type(path)}."
          )
  
      path = Path(path) if isinstance(path, str) else path
      path.mkdir()
  
      if self.model_ is not None:
          self.model_.save(path / "keras/")
  
      with open(path / "history", "wb") as history_writer:
          pickle.dump(self.history.history, history_writer)
  
      pickle.dump(type(self), open(path / "_metadata", "wb"))
      pickle.dump(self, open(path / "_obj", "wb"))
  
      shutil.make_archive(base_name=path, format="zip", root_dir=path)
      shutil.rmtree(path)
      return ZipFile(path.with_name(f"{path.stem}.zip"))
  
file_path: sktime/sktime/regression/deep_learning/base.py
imports: from abc import ABC, abstractmethod
  import numpy
  from sktime.regression.base import BaseRegressor
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 6 for calling the BaseDeepRegressor obj's underlying member method code with example usage: obj.save(path) and returns: ZipFile, type,  pickle,  in_memory_model,  in_memory_history