class_docstr: Base class for supervised methods (supports only binary classification).
  Should not be used as by itself.
  ----------
  norm : 'l1', 'l2', 'max' or None, optional
      Norm used to normalize term vectors. None for no normalization.
  smooth_df : boolean or int, default=True
      Smooth df weights by adding one to document frequencies, as if an
      extra document was seen containing every term in the collection
      exactly once. Prevents zero divisions.
  sublinear_tf : boolean, default=False
      Apply sublinear tf scaling, i.e. replace tf with 1 + log(tf).
  References
  ----------
class_docstr_tok: ["Base","class","for","supervised","methods","(","supports","only","binary","classification",")",".","Should","not","be","used","as","by","itself",".","--","--","--","--","--","norm",":","'l1","'",",","'l2","'",",","'max","'","or","None",",","optional","Norm","used","to","normalize","term","vectors",".","None","for","no","normalization",".","smooth_df",":","boolean","or","int",",","default=True","Smooth","df","weights","by","adding","one","to","document","frequencies",",","as","if","an","extra","document","was","seen","containing","every","term","in","the","collection","exactly","once",".","Prevents","zero","divisions",".","sublinear_tf",":","boolean",",","default=False","Apply","sublinear","tf","scaling",",","i.e",".","replace","tf","with","1","+","log","(","tf",")",".","References","--","--","--","--","--"]
code: def fit(self, X, y):
      n_samples, n_features = X.shape
  
      pos_samples = sp.spdiags(y, 0, n_samples, n_samples)
      neg_samples = sp.spdiags(1 - y, 0, n_samples, n_samples)
  
      X_pos = pos_samples * X
      X_neg = neg_samples * X
  
      tp = np.bincount(X_pos.indices, minlength=n_features)
      fp = np.sum(y) - tp
      tn = np.bincount(X_neg.indices, minlength=n_features)
      fn = np.sum(1 - y) - tn
  
      self._n_samples = n_samples
      self._n_features = n_features
  
      self._tp = tp
      self._fp = fp
      self._fn = fn
      self._tn = tn
      self._p = np.sum(y)
      self._n = np.sum(1 - y)
  
      if self.smooth_df:
          self._n_samples += int(self.smooth_df)
          self._tp += int(self.smooth_df)
          self._fp += int(self.smooth_df)
          self._fn += int(self.smooth_df)
          self._tn += int(self.smooth_df)
      return self
  
imports: import collections
  import itertools
  import numpy
  import scipy.sparse
  from scipy.stats import norm
  from sklearn.decomposition import TruncatedSVD
  from sklearn.preprocessing import normalize
  from sklearn.base import TransformerMixin, BaseEstimator
  from gensim.models.keyedvectors import BaseKeyedVectors
label_desc: Use image node_id 2 for calling the BaseBinaryFitter obj's underlying member method code with example usage: obj.fit(X, y) and returns: self