class_docstr: Base class for SVM.
code: def run_reg(self, X: np.ndarray) -> np.ndarray:
      if self.atts.n_supports > 0:  # type: ignore
          # length of each support vector
          mode_ = "SVM_SVC"
          kernel_type_ = self.atts.kernel_type  # type: ignore
          sv = self.atts.support_vectors.reshape((self.atts.n_supports, -1))  # type: ignore
      else:
          mode_ = "SVM_LINEAR"
          kernel_type_ = "LINEAR"
  
      z = np.empty((X.shape[0], 1), dtype=X.dtype)
      for n in range(X.shape[0]):
          s = 0.0
  
          if mode_ == "SVM_SVC":
              for j in range(self.atts.n_supports):  # type: ignore
                  d = self.kernel_dot(X[n], sv[j], kernel_type_)
                  s += self.atts.coefficients[j] * d  # type: ignore
              s += self.atts.rho[0]  # type: ignore
          elif mode_ == "SVM_LINEAR":
              s = self.kernel_dot(X[n], self.atts.coefficients, kernel_type_)  # type: ignore
              s += self.atts.rho[0]  # type: ignore
  
          if self.atts.one_class:  # type: ignore
              z[n, 0] = 1 if s > 0 else -1
          else:
              z[n, 0] = s
      return z
  
file_path: onnx/onnx/reference/ops/aionnxml/op_svm_helper.py
imports: from typing import Any
  import numpy
label_desc: Use image node_id 4 for calling the SVMCommon obj's underlying member method code with example usage: obj.run_reg(X) and returns: z