class_docstr: Transforms lists of feature-value mappings to vectors.
  
  This transformer turns lists of mappings (dict-like objects) of feature
  names to feature values into Numpy arrays or scipy.sparse matrices for use
  with scikit-learn estimators.
  
  When feature values are strings, this transformer will do a binary one-hot
  (aka one-of-K) coding: one boolean-valued feature is constructed for each
  of the possible string values that the feature can take on. For instance,
  a feature "f" that can take on the values "ham" and "spam" will become two
  features in the output, one signifying "f=ham", the other "f=spam".
  
  If a feature value is a sequence or set of strings, this transformer
  will iterate over the values and will count the occurrences of each string
  value.
  
  However, note that this transformer will only do a binary one-hot encoding
  when feature values are of type string. If categorical features are
  represented as numeric values such as int or iterables of strings, the
  DictVectorizer can be followed by
  :class:`~sklearn.preprocessing.OneHotEncoder` to complete
  binary one-hot encoding.
  
  Features that do not occur in a sample (mapping) will have a zero value
  in the resulting array/matrix.
  
  For an efficiency comparision of the different feature extractors, see
  :ref:`sphx_glr_auto_examples_text_plot_hashing_vs_dict_vectorizer.py`.
  
  Read more in the :ref:`User Guide <dict_feature_extraction>`.
  
  Parameters
  ----------
  dtype : dtype, default=np.float64
      The type of feature values. Passed to Numpy array/scipy.sparse matrix
      constructors as the dtype argument.
  separator : str, default="="
      Separator string used when constructing new features for one-hot
      coding.
  sparse : bool, default=True
      Whether transform should produce scipy.sparse matrices.
  sort : bool, default=True
      Whether ``feature_names_`` and ``vocabulary_`` should be
      sorted when fitting.
  
  Attributes
  ----------
  vocabulary_ : dict
      A dictionary mapping feature names to feature indices.
  
  feature_names_ : list
      A list of length n_features containing the feature names (e.g., "f=ham"
      and "f=spam").
  
  See Also
  --------
  FeatureHasher : Performs vectorization using only a hash function.
  sklearn.preprocessing.OrdinalEncoder : Handles nominal/categorical
      features encoded as columns of arbitrary data types.
  
  Examples
  --------
  >>> from sklearn.feature_extraction import DictVectorizer
  >>> v = DictVectorizer(sparse=False)
  >>> D = [{'foo': 1, 'bar': 2}, {'foo': 3, 'baz': 1}]
  >>> X = v.fit_transform(D)
  >>> X
  array([[2., 0., 1.],
         [0., 1., 3.]])
  >>> v.inverse_transform(X) == [{'bar': 2.0, 'foo': 1.0},
  ...                            {'baz': 1.0, 'foo': 3.0}]
  True
  >>> v.transform({'foo': 4, 'unseen_feature': 3})
  array([[0., 0., 4.]])
docstr: Learn a list of feature name -> indices mappings.
  
  Parameters
  ----------
  X : Mapping or iterable over Mappings
      Dict(s) or Mapping(s) from feature names (arbitrary Python
      objects) to feature values (strings or convertible to dtype).
  
      .. versionchanged:: 0.24
         Accepts multiple string values for one categorical feature.
  
  y : (ignored)
      Ignored parameter.
  
  Returns
  -------
  self : object
      DictVectorizer class instance.
docstr_tok: ["Learn","a","list","of","feature","name","-",">","indices","mappings",".","Parameters","--","--","--","--","--","X",":","Mapping","or","iterable","over","Mappings","Dict","(","s",")","or","Mapping","(","s",")","from","feature","names","(","arbitrary","Python","objects",")","to","feature","values","(","strings","or","convertible","to","dtype",")",".","..","versionchanged",":",":","0.24","Accepts","multiple","string","values","for","one","categorical","feature",".","y",":","(","ignored",")","Ignored","parameter",".","Returns","--","--","--","-","self",":","object","DictVectorizer","class","instance","."]
code: def fit(self, X, y=None):
      """Learn a list of feature name -> indices mappings.
  
      Parameters
      ----------
      X : Mapping or iterable over Mappings
          Dict(s) or Mapping(s) from feature names (arbitrary Python
          objects) to feature values (strings or convertible to dtype).
  
          .. versionchanged:: 0.24
             Accepts multiple string values for one categorical feature.
  
      y : (ignored)
          Ignored parameter.
  
      Returns
      -------
      self : object
          DictVectorizer class instance.
      """
      feature_names = []
      vocab = {}
  
      for x in X:
          for f, v in x.items():
              if isinstance(v, str):
                  feature_name = "%s%s%s" % (f, self.separator, v)
              elif isinstance(v, Number) or (v is None):
                  feature_name = f
              elif isinstance(v, Mapping):
                  raise TypeError(
                      f"Unsupported value type {type(v)} "
                      f"for {f}: {v}.\n"
                      "Mapping objects are not supported."
                  )
              elif isinstance(v, Iterable):
                  feature_name = None
                  self._add_iterable_element(f, v, feature_names, vocab)
  
              if feature_name is not None:
                  if feature_name not in vocab:
                      vocab[feature_name] = len(feature_names)
                      feature_names.append(feature_name)
  
      if self.sort:
          feature_names.sort()
          vocab = {f: i for i, f in enumerate(feature_names)}
  
      self.feature_names_ = feature_names
      self.vocabulary_ = vocab
  
      return self
  
imports: from array import array
  from collections.abc import Iterable, Mapping
  from numbers import Number
  from operator import itemgetter
  import numpy
  import scipy.sparse
  from ..base import BaseEstimator, TransformerMixin, _fit_context
  from ..utils import check_array
  from ..utils.validation import check_is_fitted
label_desc: Use image node_id 3 for calling the DictVectorizer obj's underlying member method code with example usage: obj.fit(X, y) and returns: self