class_docstr: Encapsulate features, labels, and metadata for a given dataset.
  
  Parameters
  ----------
  name : str
      The name of this feature set.
  
  ids : Union[List[str], numpy.ndarray]
      Example IDs for this set.
  
  labels : Optional[Union[List[str], numpy.ndarray], default=None
      Labels for this set.
  
  features : Optional[Union[:class:`skll.types.FeatureDictList`, :class:`numpy.ndarray`]], default=None
      The features for each instance represented as either a
      list of dictionaries or a numpy array (if ``vectorizer`` is
      also specified).
  
  vectorizer : Optional[Union[:class:`sklearn.feature_extraction.DictVectorizer`, :class:`sklearn.feature_extraction.FeatureHasher`], default=None
      Vectorizer which will be used to generate the feature matrix.
  
  Warnings
  --------
  FeatureSets can only be equal if the order of the instances is
  identical because these are stored as lists/arrays. Since scikit-learn's
  ``DictVectorizer`` automatically sorts the underlying feature matrix
  if it is sparse, we do not do any sorting before checking for equality.
  This is not a problem because we _always_ use sparse matrices with
  ``DictVectorizer`` when creating FeatureSets.
  
  Notes
  -----
  If ids, labels, and/or features are not None, the number of rows in
  each array must be equal.
docstr: Create a ``FeatureSet`` instance from a pandas data frame.
  
  Will raise an Exception if pandas is not installed in your environment.
  The ``ids`` in the ``FeatureSet`` will be the index from the given frame.
  
  Parameters
  ----------
  df : pandas.DataFrame
      The pandas.DataFrame object to use as a ``FeatureSet``.
  
  name : str
      The name of the output ``FeatureSet`` instance.
  
  labels_column : Optional[str], default=None
      The name of the column containing the labels (data to predict).
  
  vectorizer : Optional[Union[:class:`sklearn.feature_extraction.DictVectorizer`, :class:`sklearn.feature_extraction.FeatureHasher`]], default=None
      Vectorizer which will be used to generate the feature matrix.
  
  Returns
  -------
  :class:`skll.data.featureset.FeatureSet`
      A ``FeatureSet`` instance generated from from the given data frame.
docstr_tok: ["Create","a","``","FeatureSet","``","instance","from","a","pandas","data","frame",".","Will","raise","an","Exception","if","pandas","is","not","installed","in","your","environment",".","The","``","ids","``","in","the","``","FeatureSet","``","will","be","the","index","from","the","given","frame",".","Parameters","--","--","--","--","--","df",":","pandas.DataFrame","The","pandas.DataFrame","object","to","use","as","a","``","FeatureSet","``",".","name",":","str","The","name","of","the","output","``","FeatureSet","``","instance",".","labels_column",":","Optional","[","str","]",",","default=None","The","name","of","the","column","containing","the","labels","(","data","to","predict",")",".","vectorizer",":","Optional","[","Union","[",":","class",":","`","sklearn.feature_extraction.DictVectorizer","`",",",":","class",":","`","sklearn.feature_extraction.FeatureHasher","`","]","]",",","default=None","Vectorizer","which","will","be","used","to","generate","the","feature","matrix",".","Returns","--","--","--","-",":","class",":","`","skll.data.featureset.FeatureSet","`","A","``","FeatureSet","``","instance","generated","from","from","the","given","data","frame","."]
code: def from_data_frame(
      df: DataFrame,
      name: str,
      labels_column: Optional[str] = None,
      vectorizer: Optional[Union[DictVectorizer, FeatureHasher]] = None,
  ) -> "FeatureSet":
      """
      Create a ``FeatureSet`` instance from a pandas data frame.
  
      Will raise an Exception if pandas is not installed in your environment.
      The ``ids`` in the ``FeatureSet`` will be the index from the given frame.
  
      Parameters
      ----------
      df : pandas.DataFrame
          The pandas.DataFrame object to use as a ``FeatureSet``.
  
      name : str
          The name of the output ``FeatureSet`` instance.
  
      labels_column : Optional[str], default=None
          The name of the column containing the labels (data to predict).
  
      vectorizer : Optional[Union[:class:`sklearn.feature_extraction.DictVectorizer`, :class:`sklearn.feature_extraction.FeatureHasher`]], default=None
          Vectorizer which will be used to generate the feature matrix.
  
      Returns
      -------
      :class:`skll.data.featureset.FeatureSet`
          A ``FeatureSet`` instance generated from from the given data frame.
      """
      if labels_column:
          feature_columns = [
              column for column in df.columns if column != labels_column
          ]
          labels = df[labels_column].tolist()
      else:
          feature_columns = df.columns
          labels = None
  
      features = df[feature_columns].to_dict(orient="records")
      return FeatureSet(
          name,
          ids=df.index.tolist(),
          labels=labels,
          features=features,
          vectorizer=vectorizer,
      )
  
imports: from copy import deepcopy
  from typing import Collection, List, Optional, Tuple, Union
  import numpy
  import scipy.sparse
  from pandas import DataFrame
  from sklearn.feature_extraction import DictVectorizer, FeatureHasher
  from skll.data.dict_vectorizer import DictVectorizer
  from skll.types import FeatGenerator, FeatureDictList, IdType, LabelType, SparseFeatureMatrix
label_desc: Use image node_id 15 for calling the FeatureSet obj's underlying member method code with example usage: obj.from_data_frame(df, name, labels_column, vectorizer) and returns: FeatureSet