class_docstr: Class for TabNet model.
class_docstr_tok: ["Class","for","TabNet","model","."]
docstr: Load TabNet model.
  
  Parameters
  ----------
  filepath : str
      Path of the model.
docstr_tok: ["Load","TabNet","model",".","Parameters","--","--","--","--","--","filepath",":","str","Path","of","the","model","."]
code: def load_model(self, filepath):
      """Load TabNet model.
  
      Parameters
      ----------
      filepath : str
          Path of the model.
      """
      try:
          with zipfile.ZipFile(filepath) as z:
              with z.open("model_params.json") as f:
                  loaded_params = json.load(f)
                  loaded_params["init_params"][
                      "device_name"
                  ] = self.device_name
              with z.open("network.pt") as f:
                  try:
                      saved_state_dict = torch.load(
                          f, map_location=self.device
                      )
                  except io.UnsupportedOperation:
                      # In Python <3.7, the returned file object is not seekable (which at least
                      # some versions of PyTorch require) - so we'll try buffering it in to a
                      # BytesIO instead:
                      saved_state_dict = torch.load(
                          io.BytesIO(f.read()),
                          map_location=self.device,
                      )
      except KeyError:
          raise KeyError(
              "Your zip file is missing at least one component"
          )
  
      self.__init__(**loaded_params["init_params"])
  
      self._set_network()
      self.network.load_state_dict(saved_state_dict)
      self.network.eval()
      self.load_class_attrs(loaded_params["class_attrs"])
  
      return
  
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 9 for calling the TabModel obj's underlying member method code with example usage: obj.load_model(filepath) without return types