class_docstr: Twin multi-Label Support Vector Machines
  
  Parameters
  ----------
  c_k : int
      the empirical risk penalty parameter that determines the trade-off between the loss terms
  sor_omega: float (default is 1.0)
      the smoothing parameter
  threshold : int (default is 1e-6)
          threshold above which a label should be assigned
  lambda_param : float (default is 1.0)
          the regularization parameter
  max_iteration : int (default is 500)
          maximum number of iterations to use in successive overrelaxation
  
  
  References
  ----------
  
  If you use this classifier please cite the original paper introducing the method:
  
  .. code :: bibtex
  
      @article{chen2016mltsvm,
        title={MLTSVM: a novel twin support vector machine to multi-label learning},
        author={Chen, Wei-Jie and Shao, Yuan-Hai and Li, Chun-Na and Deng, Nai-Yang},
        journal={Pattern Recognition},
        volume={52},
        pages={61--74},
        year={2016},
        publisher={Elsevier}
      }
  
  
  Examples
  --------
  
  Here's a very simple example of using MLTSVM with a fixed number of neighbors:
  
  .. code :: python
  
      from skmultilearn.adapt import MLTSVM
  
      classifier = MLTSVM(c_k = 2**-1)
  
      # train
      classifier.fit(X_train, y_train)
  
      # predict
      predictions = classifier.predict(X_test)
  
  
  You can also use :class:`~sklearn.model_selection.GridSearchCV` to find an optimal set of parameters:
  
  .. code :: python
  
      from skmultilearn.adapt import MLTSVM
      from sklearn.model_selection import GridSearchCV
  
      parameters = {'c_k': [2**i for i in range(-5, 5, 2)]}
      score = 'f1-macro
  
      clf = GridSearchCV(MLTSVM(), parameters, scoring=score)
      clf.fit(X, y)
  
      print (clf.best_params_, clf.best_score_)
  
      # output
      {'c_k': 0.03125} 0.347518217573
code: def fit(self, X, Y):
      n_labels = Y.shape[1]
      m = X.shape[1]  # Count of features
      self.wk_bk = np.zeros([n_labels, m + 1], dtype=float)
  
      if sp.issparse(X):
          identity_matrix = sp.identity(m + 1)
          _inv = inv_sparse
      else:
          identity_matrix = np.identity(m + 1)
          _inv = inv_dense
  
      X_bias = _hstack(X, np.ones((X.shape[0], 1), dtype=X.dtype))
      self.iteration_count = []
      for label in range(0, n_labels):
          # Calculate the parameter Q for overrelaxation
          H_k = _get_x_class_instances(X_bias, Y, label)
          G_k = _get_x_noclass_instances(X_bias, Y, label)
          Q_knoPrefixGk = _inv(
              (H_k.T).dot(H_k) + self.lambda_param * identity_matrix
          ).dot(G_k.T)
          Q_k = G_k.dot(Q_knoPrefixGk).A
          Q_k = (Q_k + Q_k.T) / 2.0
  
          # Calculate other
          alpha_k = self._successive_overrelaxation(self.sor_omega, Q_k)
          if sp.issparse(X):
              self.wk_bk[label] = -Q_knoPrefixGk.dot(alpha_k).T
          else:
              self.wk_bk[label] = (-np.dot(Q_knoPrefixGk, alpha_k)).T
  
      self.wk_norms = norm(self.wk_bk, axis=1)
      self.treshold = 1.0 / np.max(self.wk_norms)
  
file_path: scikit-multilearn/skmultilearn/adapt/mltsvm.py
imports: from skmultilearn.base import MLClassifierBase
  import numpy
  import scipy.sparse
  from scipy.linalg import norm
  from scipy.sparse.linalg import inv
  from scipy.linalg import inv
label_desc: Use image node_id 2 for calling the MLTSVM obj's underlying member method code with example usage: obj.fit(X, Y) without return types