class_docstr: Extract model data and port a SVC classifier.
code: def __init__(self, estimator: SVCClass):
      super().__init__(estimator)
      L.info("Create specific estimator `%s`.", self.estimator_name)
      est = self.estimator  # alias
      params = est.get_params()
  
      sklearn_version = tuple(
          map(int, str(sklearn.__version__).split("."))
      )
  
      # Is the estimator fitted?
      try:
          est.support_vectors_
      except AttributeError:
          raise exception.NotFittedEstimatorError(self.estimator_name)
  
      # Check kernel type:
      supported_kernels = ["linear", "rbf", "poly", "sigmoid"]
      if params["kernel"] not in supported_kernels:
          msg = "The passed kernel `{}` is not supported."
          msg = msg.format(params["kernel"])
          raise exception.NotSupportedYetError(msg)
  
      if sklearn_version[:2] >= (0, 22):
          msg = (
              "You use scikit-learn>=0.22 and want to port a support "
              "vector machine. In some rare cases the regression tests "
              "failed significantly. Because of that we recommend to "
              "evaluate the ported estimator by using the `test` method."
          )
          warnings.warn(msg, exception.QualityWarning)
  
      # Check gamma value:
      gamma = params["gamma"]
      if str(gamma).startswith("auto") or str(gamma).startswith(
          "scale"
      ):
          gamma = 1.0 / len(est.support_vectors_[0])
      if sklearn_version[:2] >= (0, 22):
          gamma = str("{:.16f}").format(est._gamma)
  
      # Prepare intercepts and coefficients:
      inters = est._intercept_
      coeffs = est.dual_coef_
  
      self.model_data = dict(
          weights=est.n_support_.tolist(),
          vectors=est.support_vectors_.tolist(),
          coeffs=coeffs.tolist(),
          inters=inters.tolist(),
          kernel=params["kernel"],
          gamma=gamma,
          coef0=params["coef0"],
          degree=params["degree"],
      )
      L.info("Model data (keys): {}".format(self.model_data.keys()))
      L.opt(lazy=True).debug("Model data: {}".format(self.model_data))
  
      self.meta_info = dict(
          n_classes=len(est.classes_),
          n_features=len(est.support_vectors_[0]),
          n_weights=len(self.model_data.get("weights")),
          n_vectors=len(self.model_data.get("vectors")),
          n_coeffs=len(self.model_data.get("coeffs")),
          n_inters=len(self.model_data.get("inters")),
      )
      L.info("Meta info (keys): {}".format(self.meta_info.keys()))
      L.opt(lazy=True).debug("Meta info: {}".format(self.meta_info))
  
file_path: sklearn-porter/sklearn_porter/estimator/SVC/__init__.py
imports: import warnings
  from copy import deepcopy
  from json import dumps, encoder
  from typing import Tuple, Union, Callable
  from loguru import logger
  import sklearn
  from sklearn.svm import SVC
  from sklearn_porter import enums
  from sklearn_porter import exceptions
  from sklearn_porter.estimator.EstimatorApiABC import EstimatorApiABC
  from sklearn_porter.estimator.EstimatorBase import EstimatorBase
label_desc: Use image node_id 1 to create a new SVC object from inherited base classes: EstimatorBase, EstimatorApiABC with example: obj = SVC(estimator)