class_docstr: Class for TabNet model.
class_docstr_tok: ["Class","for","TabNet","model","."]
docstr: Saving TabNet model in two distinct files.
  
  Parameters
  ----------
  path : str
      Path of the model.
  
  Returns
  -------
  str
      input filepath with ".zip" appended
docstr_tok: ["Saving","TabNet","model","in","two","distinct","files",".","Parameters","--","--","--","--","--","path",":","str","Path","of","the","model",".","Returns","--","--","--","-","str","input","filepath","with","``",".zip","''","appended"]
code: def save_model(self, path):
      """Saving TabNet model in two distinct files.
  
      Parameters
      ----------
      path : str
          Path of the model.
  
      Returns
      -------
      str
          input filepath with ".zip" appended
  
      """
      saved_params = {}
      init_params = {}
      for key, val in self.get_params().items():
          if isinstance(val, type):
              # Don't save torch specific params
              continue
          else:
              init_params[key] = val
      saved_params["init_params"] = init_params
  
      class_attrs = {"preds_mapper": self.preds_mapper}
      saved_params["class_attrs"] = class_attrs
  
      # Create folder
      Path(path).mkdir(parents=True, exist_ok=True)
  
      # Save models params
      with open(
          Path(path).joinpath("model_params.json"), "w", encoding="utf8"
      ) as f:
          json.dump(saved_params, f, cls=ComplexEncoder)
  
      # Save state_dict
      torch.save(
          self.network.state_dict(), Path(path).joinpath("network.pt")
      )
      shutil.make_archive(path, "zip", path)
      shutil.rmtree(path)
      print(f"Successfully saved model at {path}.zip")
      return f"{path}.zip"
  
imports: from dataclasses import dataclass, field
  from typing import List, Any, Dict
  import torch
  from torch.nn.utils import clip_grad_norm_
  import numpy
  from scipy.sparse import csc_matrix
  from abc import abstractmethod
  from pytorch_tabnet import tab_network
  from pytorch_tabnet.utils import SparsePredictDataset, PredictDataset, create_explain_matrix, validate_eval_set, create_dataloaders, define_device, ComplexEncoder, check_input, check_warm_start, create_group_matrix, check_embedding_parameters
  from pytorch_tabnet.callbacks import CallbackContainer, History, EarlyStopping, LRSchedulerCallback
  from pytorch_tabnet.metrics import MetricContainer, check_metrics
  from sklearn.base import BaseEstimator
  from torch.utils.data import DataLoader
  import io
  import json
  from pathlib import Path
  import shutil
  import zipfile
  import warnings
  import copy
  import scipy
label_desc: Use image node_id 8 for calling the TabModel obj's underlying member method code with example usage: obj.save_model(path) and returns: path, str