class_docstr: Binary Relevance adapted kNN Multi-Label Classifier base class.
class_docstr_tok: ["Binary","Relevance","adapted","kNN","Multi-Label","Classifier","base","class","."]
docstr: Fit classifier with training data
  
  Internally this method uses a sparse CSC representation for y
  (:class:`scipy.sparse.csc_matrix`).
  
  Parameters
  ----------
  X : numpy.ndarray or scipy.sparse
      input features, can be a dense or sparse matrix of size
      :code:`(n_samples, n_features)`
  y : numpy.ndaarray or scipy.sparse {0,1}
      binary indicator matrix with label assignments.
  
  Returns
  -------
  self
      fitted instance of self
docstr_tok: ["Fit","classifier","with","training","data","Internally","this","method","uses","a","sparse","CSC","representation","for","y","(",":","class",":","`","scipy.sparse.csc_matrix","`",")",".","Parameters","--","--","--","--","--","X",":","numpy.ndarray","or","scipy.sparse","input","features",",","can","be","a","dense","or","sparse","matrix","of","size",":","code",":","`","(","n_samples",",","n_features",")","`","y",":","numpy.ndaarray","or","scipy.sparse","{","0,1","}","binary","indicator","matrix","with","label","assignments",".","Returns","--","--","--","-","self","fitted","instance","of","self"]
code: def fit(self, X, y):
      """Fit classifier with training data
  
      Internally this method uses a sparse CSC representation for y
      (:class:`scipy.sparse.csc_matrix`).
  
      Parameters
      ----------
      X : numpy.ndarray or scipy.sparse
          input features, can be a dense or sparse matrix of size
          :code:`(n_samples, n_features)`
      y : numpy.ndaarray or scipy.sparse {0,1}
          binary indicator matrix with label assignments.
  
      Returns
      -------
      self
          fitted instance of self
      """
      self.train_labelspace = get_matrix_in_format(y, "csc")
      self._n_samples = self.train_labelspace.shape[0]
      self._n_labels = self.train_labelspace.shape[1]
      self.knn_ = NearestNeighbors(n_neighbors=self.k).fit(X)
      return self
  
file_path: scikit-multilearn/skmultilearn/adapt/brknn.py
imports: from builtins import range
  from ..base import MLClassifierBase
  from ..utils import get_matrix_in_format
  from sklearn.neighbors import NearestNeighbors
  import scipy.sparse
  import numpy
label_desc: Use image node_id 2 for calling the _BinaryRelevanceKNN obj's underlying member method code with example usage: obj.fit(X, y) and returns: self