evalml.utils.infer_feature_types

evalml.utils.infer_feature_types(data, feature_types=None)[source]
Create a Woodwork structure from the given list, pandas, or numpy input, with specified types for columns.

If a column’s type is not specified, it will be inferred by Woodwork.

Parameters
  • data (pd.DataFrame) – Input data to convert to a Woodwork data structure.

  • feature_types (string, ww.logical_type obj, dict, optional) – If data is a 2D structure, feature_types must be a dictionary mapping column names to the type of data represented in the column. If data is a 1D structure, then feature_types must be a Woodwork logical type or a string representing a Woodwork logical type (“Double”, “Integer”, “Boolean”, “Categorical”, “Datetime”, “NaturalLanguage”)

Returns

A Woodwork data structure where the data type of each column was either specified or inferred.