column_selectors =================================================================== .. py:module:: evalml.pipelines.components.transformers.column_selectors .. autoapi-nested-parse:: Initalizes an transformer that selects specified columns in input data. Module Contents --------------- Classes Summary ~~~~~~~~~~~~~~~ .. autoapisummary:: evalml.pipelines.components.transformers.column_selectors.ColumnSelector evalml.pipelines.components.transformers.column_selectors.DropColumns evalml.pipelines.components.transformers.column_selectors.SelectByType evalml.pipelines.components.transformers.column_selectors.SelectColumns Contents ~~~~~~~~~~~~~~~~~~~ .. py:class:: ColumnSelector(columns=None, random_seed=0, **kwargs) Initalizes an transformer that selects specified columns in input data. :param columns: List of column names, used to determine which columns to select. :type columns: list(string) :param random_seed: Seed for the random number generator. Defaults to 0. :type random_seed: int **Attributes** .. list-table:: :widths: 15 85 :header-rows: 0 * - **modifies_features** - True * - **modifies_target** - False * - **training_only** - False **Methods** .. autoapisummary:: :nosignatures: evalml.pipelines.components.transformers.column_selectors.ColumnSelector.clone evalml.pipelines.components.transformers.column_selectors.ColumnSelector.default_parameters evalml.pipelines.components.transformers.column_selectors.ColumnSelector.describe evalml.pipelines.components.transformers.column_selectors.ColumnSelector.fit evalml.pipelines.components.transformers.column_selectors.ColumnSelector.fit_transform evalml.pipelines.components.transformers.column_selectors.ColumnSelector.load evalml.pipelines.components.transformers.column_selectors.ColumnSelector.name evalml.pipelines.components.transformers.column_selectors.ColumnSelector.needs_fitting evalml.pipelines.components.transformers.column_selectors.ColumnSelector.parameters evalml.pipelines.components.transformers.column_selectors.ColumnSelector.save evalml.pipelines.components.transformers.column_selectors.ColumnSelector.transform evalml.pipelines.components.transformers.column_selectors.ColumnSelector.update_parameters .. py:method:: clone(self) Constructs a new component with the same parameters and random state. :returns: A new instance of this component with identical parameters and random state. .. py:method:: default_parameters(cls) Returns the default parameters for this component. Our convention is that Component.default_parameters == Component().parameters. :returns: Default parameters for this component. :rtype: dict .. py:method:: describe(self, print_name=False, return_dict=False) Describe a component and its parameters. :param print_name: whether to print name of component :type print_name: bool, optional :param return_dict: whether to return description as dictionary in the format {"name": name, "parameters": parameters} :type return_dict: bool, optional :returns: Returns dictionary if return_dict is True, else None. :rtype: None or dict .. py:method:: fit(self, X, y=None) Fits the transformer by checking if column names are present in the dataset. :param X: Data to check. :type X: pd.DataFrame :param y: Targets. :type y: pd.Series, ignored :returns: self .. py:method:: fit_transform(self, X, y=None) Fits on X and transforms X. :param X: Data to fit and transform. :type X: pd.DataFrame :param y: Target data. :type y: pd.Series :returns: Transformed X. :rtype: pd.DataFrame :raises MethodPropertyNotFoundError: If transformer does not have a transform method or a component_obj that implements transform. .. py:method:: load(file_path) :staticmethod: Loads component at file path. :param file_path: Location to load file. :type file_path: str :returns: ComponentBase object .. py:method:: name(cls) :property: Returns string name of this component. .. py:method:: needs_fitting(self) Returns boolean determining if component needs fitting before calling predict, predict_proba, transform, or feature_importances. This can be overridden to False for components that do not need to be fit or whose fit methods do nothing. :returns: True. .. py:method:: parameters(self) :property: Returns the parameters which were used to initialize the component. .. py:method:: save(self, file_path, pickle_protocol=cloudpickle.DEFAULT_PROTOCOL) Saves component at file path. :param file_path: Location to save file. :type file_path: str :param pickle_protocol: The pickle data stream format. :type pickle_protocol: int .. py:method:: transform(self, X, y=None) Transform data using fitted column selector component. :param X: The input training data of shape [n_samples, n_features]. :type X: pd.DataFrame :param y: The target training data of length [n_samples]. :type y: pd.Series, optional :returns: Transformed data. :rtype: pd.DataFrame .. py:method:: update_parameters(self, update_dict, reset_fit=True) Updates the parameter dictionary of the component. :param update_dict: A dict of parameters to update. :type update_dict: dict :param reset_fit: If True, will set `_is_fitted` to False. :type reset_fit: bool, optional .. py:class:: DropColumns(columns=None, random_seed=0, **kwargs) Drops specified columns in input data. :param columns: List of column names, used to determine which columns to drop. :type columns: list(string) :param random_seed: Seed for the random number generator. Defaults to 0. :type random_seed: int **Attributes** .. list-table:: :widths: 15 85 :header-rows: 0 * - **hyperparameter_ranges** - {} * - **modifies_features** - True * - **modifies_target** - False * - **name** - Drop Columns Transformer * - **needs_fitting** - False * - **training_only** - False **Methods** .. autoapisummary:: :nosignatures: evalml.pipelines.components.transformers.column_selectors.DropColumns.clone evalml.pipelines.components.transformers.column_selectors.DropColumns.default_parameters evalml.pipelines.components.transformers.column_selectors.DropColumns.describe evalml.pipelines.components.transformers.column_selectors.DropColumns.fit evalml.pipelines.components.transformers.column_selectors.DropColumns.fit_transform evalml.pipelines.components.transformers.column_selectors.DropColumns.load evalml.pipelines.components.transformers.column_selectors.DropColumns.parameters evalml.pipelines.components.transformers.column_selectors.DropColumns.save evalml.pipelines.components.transformers.column_selectors.DropColumns.transform evalml.pipelines.components.transformers.column_selectors.DropColumns.update_parameters .. py:method:: clone(self) Constructs a new component with the same parameters and random state. :returns: A new instance of this component with identical parameters and random state. .. py:method:: default_parameters(cls) Returns the default parameters for this component. Our convention is that Component.default_parameters == Component().parameters. :returns: Default parameters for this component. :rtype: dict .. py:method:: describe(self, print_name=False, return_dict=False) Describe a component and its parameters. :param print_name: whether to print name of component :type print_name: bool, optional :param return_dict: whether to return description as dictionary in the format {"name": name, "parameters": parameters} :type return_dict: bool, optional :returns: Returns dictionary if return_dict is True, else None. :rtype: None or dict .. py:method:: fit(self, X, y=None) Fits the transformer by checking if column names are present in the dataset. :param X: Data to check. :type X: pd.DataFrame :param y: Targets. :type y: pd.Series, ignored :returns: self .. py:method:: fit_transform(self, X, y=None) Fits on X and transforms X. :param X: Data to fit and transform. :type X: pd.DataFrame :param y: Target data. :type y: pd.Series :returns: Transformed X. :rtype: pd.DataFrame :raises MethodPropertyNotFoundError: If transformer does not have a transform method or a component_obj that implements transform. .. py:method:: load(file_path) :staticmethod: Loads component at file path. :param file_path: Location to load file. :type file_path: str :returns: ComponentBase object .. py:method:: parameters(self) :property: Returns the parameters which were used to initialize the component. .. py:method:: save(self, file_path, pickle_protocol=cloudpickle.DEFAULT_PROTOCOL) Saves component at file path. :param file_path: Location to save file. :type file_path: str :param pickle_protocol: The pickle data stream format. :type pickle_protocol: int .. py:method:: transform(self, X, y=None) Transforms data X by dropping columns. :param X: Data to transform. :type X: pd.DataFrame :param y: Targets. :type y: pd.Series, optional :returns: Transformed X. :rtype: pd.DataFrame .. py:method:: update_parameters(self, update_dict, reset_fit=True) Updates the parameter dictionary of the component. :param update_dict: A dict of parameters to update. :type update_dict: dict :param reset_fit: If True, will set `_is_fitted` to False. :type reset_fit: bool, optional .. py:class:: SelectByType(column_types=None, exclude=False, random_seed=0, **kwargs) Selects columns by specified Woodwork logical type or semantic tag in input data. :param column_types: List of Woodwork types or tags, used to determine which columns to select or exclude. :type column_types: string, ww.LogicalType, list(string), list(ww.LogicalType) :param exclude: If true, exclude the column_types instead of including them. Defaults to False. :type exclude: bool :param random_seed: Seed for the random number generator. Defaults to 0. :type random_seed: int **Attributes** .. list-table:: :widths: 15 85 :header-rows: 0 * - **hyperparameter_ranges** - {} * - **modifies_features** - True * - **modifies_target** - False * - **name** - Select Columns By Type Transformer * - **needs_fitting** - False * - **training_only** - False **Methods** .. autoapisummary:: :nosignatures: evalml.pipelines.components.transformers.column_selectors.SelectByType.clone evalml.pipelines.components.transformers.column_selectors.SelectByType.default_parameters evalml.pipelines.components.transformers.column_selectors.SelectByType.describe evalml.pipelines.components.transformers.column_selectors.SelectByType.fit evalml.pipelines.components.transformers.column_selectors.SelectByType.fit_transform evalml.pipelines.components.transformers.column_selectors.SelectByType.load evalml.pipelines.components.transformers.column_selectors.SelectByType.parameters evalml.pipelines.components.transformers.column_selectors.SelectByType.save evalml.pipelines.components.transformers.column_selectors.SelectByType.transform evalml.pipelines.components.transformers.column_selectors.SelectByType.update_parameters .. py:method:: clone(self) Constructs a new component with the same parameters and random state. :returns: A new instance of this component with identical parameters and random state. .. py:method:: default_parameters(cls) Returns the default parameters for this component. Our convention is that Component.default_parameters == Component().parameters. :returns: Default parameters for this component. :rtype: dict .. py:method:: describe(self, print_name=False, return_dict=False) Describe a component and its parameters. :param print_name: whether to print name of component :type print_name: bool, optional :param return_dict: whether to return description as dictionary in the format {"name": name, "parameters": parameters} :type return_dict: bool, optional :returns: Returns dictionary if return_dict is True, else None. :rtype: None or dict .. py:method:: fit(self, X, y=None) Fits the transformer by checking if column names are present in the dataset. :param X: Data to check. :type X: pd.DataFrame :param y: Targets. :type y: pd.Series, ignored :returns: self .. py:method:: fit_transform(self, X, y=None) Fits on X and transforms X. :param X: Data to fit and transform. :type X: pd.DataFrame :param y: Target data. :type y: pd.Series :returns: Transformed X. :rtype: pd.DataFrame :raises MethodPropertyNotFoundError: If transformer does not have a transform method or a component_obj that implements transform. .. py:method:: load(file_path) :staticmethod: Loads component at file path. :param file_path: Location to load file. :type file_path: str :returns: ComponentBase object .. py:method:: parameters(self) :property: Returns the parameters which were used to initialize the component. .. py:method:: save(self, file_path, pickle_protocol=cloudpickle.DEFAULT_PROTOCOL) Saves component at file path. :param file_path: Location to save file. :type file_path: str :param pickle_protocol: The pickle data stream format. :type pickle_protocol: int .. py:method:: transform(self, X, y=None) Transforms data X by selecting columns. :param X: Data to transform. :type X: pd.DataFrame :param y: Targets. :type y: pd.Series, optional :returns: Transformed X. :rtype: pd.DataFrame .. py:method:: update_parameters(self, update_dict, reset_fit=True) Updates the parameter dictionary of the component. :param update_dict: A dict of parameters to update. :type update_dict: dict :param reset_fit: If True, will set `_is_fitted` to False. :type reset_fit: bool, optional .. py:class:: SelectColumns(columns=None, random_seed=0, **kwargs) Selects specified columns in input data. :param columns: List of column names, used to determine which columns to select. If columns are not present, they will not be selected. :type columns: list(string) :param random_seed: Seed for the random number generator. Defaults to 0. :type random_seed: int **Attributes** .. list-table:: :widths: 15 85 :header-rows: 0 * - **hyperparameter_ranges** - {} * - **modifies_features** - True * - **modifies_target** - False * - **name** - Select Columns Transformer * - **needs_fitting** - False * - **training_only** - False **Methods** .. autoapisummary:: :nosignatures: evalml.pipelines.components.transformers.column_selectors.SelectColumns.clone evalml.pipelines.components.transformers.column_selectors.SelectColumns.default_parameters evalml.pipelines.components.transformers.column_selectors.SelectColumns.describe evalml.pipelines.components.transformers.column_selectors.SelectColumns.fit evalml.pipelines.components.transformers.column_selectors.SelectColumns.fit_transform evalml.pipelines.components.transformers.column_selectors.SelectColumns.load evalml.pipelines.components.transformers.column_selectors.SelectColumns.parameters evalml.pipelines.components.transformers.column_selectors.SelectColumns.save evalml.pipelines.components.transformers.column_selectors.SelectColumns.transform evalml.pipelines.components.transformers.column_selectors.SelectColumns.update_parameters .. py:method:: clone(self) Constructs a new component with the same parameters and random state. :returns: A new instance of this component with identical parameters and random state. .. py:method:: default_parameters(cls) Returns the default parameters for this component. Our convention is that Component.default_parameters == Component().parameters. :returns: Default parameters for this component. :rtype: dict .. py:method:: describe(self, print_name=False, return_dict=False) Describe a component and its parameters. :param print_name: whether to print name of component :type print_name: bool, optional :param return_dict: whether to return description as dictionary in the format {"name": name, "parameters": parameters} :type return_dict: bool, optional :returns: Returns dictionary if return_dict is True, else None. :rtype: None or dict .. py:method:: fit(self, X, y=None) Fits the transformer by checking if column names are present in the dataset. :param X: Data to check. :type X: pd.DataFrame :param y: Targets. :type y: pd.Series, optional :returns: self .. py:method:: fit_transform(self, X, y=None) Fits on X and transforms X. :param X: Data to fit and transform. :type X: pd.DataFrame :param y: Target data. :type y: pd.Series :returns: Transformed X. :rtype: pd.DataFrame :raises MethodPropertyNotFoundError: If transformer does not have a transform method or a component_obj that implements transform. .. py:method:: load(file_path) :staticmethod: Loads component at file path. :param file_path: Location to load file. :type file_path: str :returns: ComponentBase object .. py:method:: parameters(self) :property: Returns the parameters which were used to initialize the component. .. py:method:: save(self, file_path, pickle_protocol=cloudpickle.DEFAULT_PROTOCOL) Saves component at file path. :param file_path: Location to save file. :type file_path: str :param pickle_protocol: The pickle data stream format. :type pickle_protocol: int .. py:method:: transform(self, X, y=None) Transform data using fitted column selector component. :param X: The input training data of shape [n_samples, n_features]. :type X: pd.DataFrame :param y: The target training data of length [n_samples]. :type y: pd.Series, optional :returns: Transformed data. :rtype: pd.DataFrame .. py:method:: update_parameters(self, update_dict, reset_fit=True) Updates the parameter dictionary of the component. :param update_dict: A dict of parameters to update. :type update_dict: dict :param reset_fit: If True, will set `_is_fitted` to False. :type reset_fit: bool, optional