class_docstr: "
  Implementation of the K-Nearest Neighbors-Equality technique.
  
  This implementation fits a different KNN method for each class, and search
  on each class for the nearest examples.
  
  Parameters
  ----------
  
  n_neighbors : int, (default = 7)
      Number of neighbors to use by default for :meth:`kneighbors` queries.
  
  algorithm : str = ['knn', 'faiss]', (default = 'knn')
      Whether to use scikit-learn or faiss for nearest neighbors estimation.
  
  References
  ----------
  Sierra, Basilio, Elena Lazkano, Itziar Irigoien, Ekaitz Jauregi,
  and Iñigo Mendialdua. "K nearest neighbor equality: giving equal chance
  to all existing classes."
  Information Sciences 181, no. 23 (2011): 5158-5168.
  
  Mendialdua, Iñigo, José María Martínez-Otzeta, I. Rodriguez-Rodriguez,
  T. Ruiz-Vazquez, and Basilio Sierra. "Dynamic selection of the best base
  classifier in one versus one." Knowledge-Based Systems 85 (2015): 298-306.
  
  Cruz, Rafael MO, Dayvid VR Oliveira, George DC Cavalcanti,
  and Robert Sabourin. "FIRE-DES++: Enhanced online pruning of base
  classifiers for dynamic ensemble selection."
  Pattern Recognition 85 (2019): 149-160.
class_docstr_tok: ["``","Implementation","of","the","K-Nearest","Neighbors-Equality","technique",".","This","implementation","fits","a","different","KNN","method","for","each","class",",","and","search","on","each","class","for","the","nearest","examples",".","Parameters","--","--","--","--","--","n_neighbors",":","int",",","(","default","=","7",")","Number","of","neighbors","to","use","by","default","for",":","meth",":","`","kneighbors","`","queries",".","algorithm",":","str","=","[","'knn","'",",","'faiss","]","'",",","(","default","=","'knn","'",")","Whether","to","use","scikit-learn","or","faiss","for","nearest","neighbors","estimation",".","References","--","--","--","--","--","Sierra",",","Basilio",",","Elena","Lazkano",",","Itziar","Irigoien",",","Ekaitz","Jauregi",",","and","I\u00f1igo","Mendialdua",".","``","K","nearest","neighbor","equality",":","giving","equal","chance","to","all","existing","classes",".","''","Information","Sciences","181",",","no",".","23","(","2011",")",":","5158-5168",".","Mendialdua",",","I\u00f1igo",",","Jos\u00e9","Mar\u00eda","Mart\u00ednez-Otzeta",",","I.","Rodriguez-Rodriguez",",","T.","Ruiz-Vazquez",",","and","Basilio","Sierra",".","``","Dynamic","selection","of","the","best","base","classifier","in","one","versus","one",".","''","Knowledge-Based","Systems","85","(","2015",")",":","298-306",".","Cruz",",","Rafael","MO",",","Dayvid","VR","Oliveira",",","George","DC","Cavalcanti",",","and","Robert","Sabourin",".","``","FIRE-DES++",":","Enhanced","online","pruning","of","base","classifiers","for","dynamic","ensemble","selection",".","''","Pattern","Recognition","85","(","2019",")",":","149-160","."]
code: def _check_n_neighbors(self, n_neighbors):
      if n_neighbors is None:
          raise ValueError(
              '"n_neighbors" is required for the KNN-E model.'
          )
  
      if n_neighbors < self.n_classes_:
          raise ValueError(
              '"n_neighbors" must be equals or higher than '
              "the number of classes. Got {}.".format(n_neighbors)
          )
  
      if not np.issubdtype(type(n_neighbors), np.integer):
          raise TypeError(
              "n_neighbors does not take {} value, "
              "enter integer value".format(type(n_neighbors))
          )
  
file_path: DESlib/deslib/util/knne.py
imports: import warnings
  import numpy
  from sklearn.base import BaseEstimator
  from sklearn.neighbors import KNeighborsClassifier
  from sklearn.utils import check_X_y
  from sklearn.utils import check_array
  from deslib.util import faiss_knn_wrapper
  from deslib.util.prob_functions import softmax
label_desc: Use image node_id 8 for calling the KNNE obj's underlying member method code with example usage: obj._check_n_neighbors(n_neighbors) without return types