class_docstr: Convert a pandas DataFrame to a suitable VW format.
  Instances of this class are built with classes such as SimpleLabel,
  MulticlassLabel, Feature or Namespace.
  
  The class also provided a convenience constructor to initialize the class
  based on the target/features column names only.
class_docstr_tok: ["Convert","a","pandas","DataFrame","to","a","suitable","VW","format",".","Instances","of","this","class","are","built","with","classes","such","as","SimpleLabel",",","MulticlassLabel",",","Feature","or","Namespace",".","The","class","also","provided","a","convenience","constructor","to","initialize","the","class","based","on","the","target\/features","column","names","only","."]
docstr: Build DFtoVW instance using column names only.
  
      .. deprecated:: 9.2.0
          Use :meth:`DFtoVW.from_column_names` instead.
  
  Args:
      y: (list of) any hashable type (str/int/float/tuple/etc.) representing a column name
          The column for the label.
      x: (list of) any hashable type (str/int/float/tuple/etc.) representing a column name
          The column(s) for the feature(s).
      df: The dataframe used.
      label_type: The type of the label. Available labels: 'simple_label', 'multiclass_label', 'multi_label'. (default: 'simple_label')
  
  Raises:
      TypeError: If argument label is not of valid type.
      ValueError: If argument label_type is not valid.
  
  Examples:
      >>> from vowpalwabbit.dftovw import DFtoVW
      >>> import pandas as pd
      >>> df = pd.DataFrame({"y": [1], "x": [2]})
      >>> conv = DFtoVW.from_colnames(y="y", x="x", df=df)
      >>> conv.convert_df()
      ['1 | x:2']
  
      >>> df2 = pd.DataFrame({"y": [1], "x1": [2], "x2": [3], "x3": [4]})
      >>> conv2 = DFtoVW.from_colnames(y="y", x=sorted(list(set(df2.columns) - set("y"))), df=df2)
      >>> conv2.convert_df()
      ['1 | x1:2 x2:3 x3:4']
  
  Returns:
      An initialized DFtoVW instance.
docstr_tok: ["Build","DFtoVW","instance","using","column","names","only",".","..","deprecated",":",":","9.2.0","Use",":","meth",":","`","DFtoVW.from_column_names","`","instead",".","Args",":","y",":","(","list","of",")","any","hashable","type","(","str\/int\/float\/tuple\/etc",".",")","representing","a","column","name","The","column","for","the","label",".","x",":","(","list","of",")","any","hashable","type","(","str\/int\/float\/tuple\/etc",".",")","representing","a","column","name","The","column","(","s",")","for","the","feature","(","s",")",".","df",":","The","dataframe","used",".","label_type",":","The","type","of","the","label",".","Available","labels",":","'simple_label","'",",","'multiclass_label","'",",","'multi_label","'",".","(","default",":","'simple_label","'",")","Raises",":","TypeError",":","If","argument","label","is","not","of","valid","type",".","ValueError",":","If","argument","label_type","is","not","valid",".","Examples",":",">",">",">","from","vowpalwabbit.dftovw","import","DFtoVW",">",">",">","import","pandas","as","pd",">",">",">","df","=","pd.DataFrame","(","{","``","y","''",":","[","1","]",",","``","x","''",":","[","2","]","}",")",">",">",">","conv","=","DFtoVW.from_colnames","(","y=","''","y","''",",","x=","''","x","''",",","df=df",")",">",">",">","conv.convert_df","(",")","[","'","1","|","x:2","'","]",">",">",">","df2","=","pd.DataFrame","(","{","``","y","''",":","[","1","]",",","``","x1","''",":","[","2","]",",","``","x2","''",":","[","3","]",",","``","x3","''",":","[","4","]","}",")",">",">",">","conv2","=","DFtoVW.from_colnames","(","y=","''","y","''",",","x=sorted","(","list","(","set","(","df2.columns",")","-","set","(","``","y","''",")",")",")",",","df=df2",")",">",">",">","conv2.convert_df","(",")","[","'","1","|","x1:2","x2:3","x3:4","'","]","Returns",":","An","initialized","DFtoVW","instance","."]
code: def from_colnames(
      cls,
      y: Union[Hashable, List[Hashable]],
      x: Union[Hashable, List[Hashable]],
      df: pd.DataFrame,
      label_type: str = "simple_label",
  ) -> "DFtoVW":
      """Build DFtoVW instance using column names only.
  
          .. deprecated:: 9.2.0
              Use :meth:`DFtoVW.from_column_names` instead.
  
      Args:
          y: (list of) any hashable type (str/int/float/tuple/etc.) representing a column name
              The column for the label.
          x: (list of) any hashable type (str/int/float/tuple/etc.) representing a column name
              The column(s) for the feature(s).
          df: The dataframe used.
          label_type: The type of the label. Available labels: 'simple_label', 'multiclass_label', 'multi_label'. (default: 'simple_label')
  
      Raises:
          TypeError: If argument label is not of valid type.
          ValueError: If argument label_type is not valid.
  
      Examples:
          >>> from vowpalwabbit.dftovw import DFtoVW
          >>> import pandas as pd
          >>> df = pd.DataFrame({"y": [1], "x": [2]})
          >>> conv = DFtoVW.from_colnames(y="y", x="x", df=df)
          >>> conv.convert_df()
          ['1 | x:2']
  
          >>> df2 = pd.DataFrame({"y": [1], "x1": [2], "x2": [3], "x3": [4]})
          >>> conv2 = DFtoVW.from_colnames(y="y", x=sorted(list(set(df2.columns) - set("y"))), df=df2)
          >>> conv2.convert_df()
          ['1 | x1:2 x2:3 x3:4']
  
      Returns:
          An initialized DFtoVW instance.
      """
  
      warnings.warn(
          "DFtoVW.from_colnames is deprecated. Use DFtoVW.from_column_names instead.",
          DeprecationWarning,
      )
      return cls.from_column_names(
          y=y, x=x, df=df, label_type=label_type
      )
  
imports: import warnings
  import numpy
  import pandas
  from typing import Any, Hashable, List, Optional, Tuple, Type, Union
label_desc: Use image node_id 2 for calling the DFtoVW obj's underlying member method code with example usage: obj.from_colnames(cls, y, x, df, label_type) and returns: cls