evalml.pipelines.components.OneHotEncoder

class evalml.pipelines.components.OneHotEncoder(top_n=10, features_to_encode=None, categories=None, drop=None, handle_unknown='ignore', handle_missing='error', random_state=0, **kwargs)[source]

One-hot encoder to encode non-numeric data.

name = 'One Hot Encoder'
model_family = 'none'
hyperparameter_ranges = {}
default_parameters = {'categories': None, 'drop': None, 'features_to_encode': None, 'handle_missing': 'error', 'handle_unknown': 'ignore', 'top_n': 10}

Instance attributes

needs_fitting

parameters

Returns the parameters which were used to initialize the component

Methods:

__init__

Initalizes an transformer that encodes categorical features in a one-hot numeric array.”

categories

Returns a list of the unique categories to be encoded for the particular feature, in order.

clone

Constructs a new component with the same parameters and random state.

describe

Describe a component and its parameters

fit

Fits component to data

fit_transform

Fits on X and transforms X

get_feature_names

Return feature names for the categorical features after fitting.

load

Loads component at file path

save

Saves component at file path

transform

One-hot encode the input data.

Class Inheritance

Inheritance diagram of OneHotEncoder