class_docstr: A list-like object with feature names. It allows
  feature names for unknown features to be generated using
  a provided template, and to avoid making copies of large objects
  in get_feature_names.
class_docstr_tok: ["A","list-like","object","with","feature","names",".","It","allows","feature","names","for","unknown","features","to","be","generated","using","a","provided","template",",","and","to","avoid","making","copies","of","large","objects","in","get_feature_names","."]
docstr: Add a new feature name, return it's index.
          
docstr_tok: ["Add","a","new","feature","name",",","return","it","'s","index","."]
code: def add_feature(self, feature):
      # type: (Any) -> int
      """Add a new feature name, return it's index."""
      # A copy of self.feature_names is always made, because it might be
      # "owned" by someone else.
      # It's possible to make the copy only at the first call to
      # self.add_feature to improve performance.
      idx = self.n_features
      if isinstance(self.feature_names, (list, np.ndarray)):
          self.feature_names = list(self.feature_names)
          self.feature_names.append(feature)
      elif isinstance(self.feature_names, dict):
          self.feature_names = dict(self.feature_names)
          self.feature_names[idx] = feature
      elif self.feature_names is None:
          self.feature_names = {idx: feature}
      self.n_features += 1
      return idx
  
file_path: eli5/eli5/_feature_names.py
imports: import re
  import six
  from typing import Any, Iterable, Iterator, Tuple, Sized, List, Optional, Dict, Union, Callable, Pattern
  import numpy
  import scipy.sparse
label_desc: Use image node_id 11 for calling the FeatureNames obj's underlying member method code with example usage: obj.add_feature(feature) and returns: idx