mlxtend version: 0.23.1

CopyTransformer

CopyTransformer()

返回输入数组的副本的转换器

有关使用示例,请参见
https://rasbt.github.io/mlxtend/user_guide/preprocessing/CopyTransformer/

Methods


fit(X, y=None)

Mock方法.不执行任何操作.

Parameters

Returns

self


fit_transform(X, y=None)

Return a copy of the input array.

Parameters

Returns


get_metadata_routing()

Get metadata routing of this object.

Please check :ref:`User Guide <metadata_routing>` on how the routing
mechanism works.

Returns


get_params(deep=True)

Get parameters for this estimator.

Parameters

Returns


set_params(params)

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects
(such as :class:`~sklearn.pipeline.Pipeline`). The latter have
parameters of the form ``<component>__<parameter>`` so that it's
possible to update each component of a nested object.

Parameters

Returns


transform(X, y=None)

Return a copy of the input array.

Parameters

Returns

DenseTransformer

DenseTransformer(return_copy=True)

将稀疏数组转换为密集数组.

有关使用示例,请参见
https://rasbt.github.io/mlxtend/user_guide/preprocessing/DenseTransformer/

Methods


fit(X, y=None)

Mock方法.什么也不做.

Parameters

Returns

self


fit_transform(X, y=None)

返回输入数组的密集版本.

Parameters

Returns


get_metadata_routing()

Get metadata routing of this object.

Please check :ref:`User Guide <metadata_routing>` on how the routing
mechanism works.

Returns


get_params(deep=True)

Get parameters for this estimator.

Parameters

Returns


set_params(params)

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects
(such as :class:`~sklearn.pipeline.Pipeline`). The latter have
parameters of the form ``<component>__<parameter>`` so that it's
possible to update each component of a nested object.

Parameters

Returns


transform(X, y=None)

返回输入数组的密集版本.

Parameters

Returns

MeanCenterer

MeanCenterer()

向量和矩阵的列中心化.

Attributes

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/preprocessing/MeanCenterer/

Methods


fit(X)

获取用于均值中心化的列均值.

Parameters

Returns

self


fit_transform(X)

拟合并转换一个数组.

Parameters

Returns


transform(X)

中心化一个NumPy数组.

Parameters

Returns

TransactionEncoder

TransactionEncoder()

Python列表中交易数据的编码器类

Parameters

Attributes

columns_: 列表 在输入列表 X 中的唯一名称列表

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/preprocessing/TransactionEncoder/

Methods


fit(X)

从交易DataFrame中学习唯一的列名

Parameters


fit_transform(X, sparse=False)

拟合一个TransactionEncoder编码器并转换数据集.


get_metadata_routing()

Get metadata routing of this object.

Please check :ref:`User Guide <metadata_routing>` on how the routing
mechanism works.

Returns


get_params(deep=True)

Get parameters for this estimator.

Parameters

Returns


inverse_transform(array)

将编码后的NumPy数组转换回交易记录.

Parameters

Returns


set_inverse_transform_request(self: mlxtend.preprocessing.transactionencoder.TransactionEncoder, , array: Union[bool, NoneType, str] = '$UNCHANGED$') -> mlxtend.preprocessing.transactionencoder.TransactionEncoder*

Request metadata passed to the inverse_transform method.

Note that this method is only relevant if
``enable_metadata_routing=True`` (see :func:`sklearn.set_config`).
Please see :ref:`User Guide <metadata_routing>` on how the routing
mechanism works.

The options for each parameter are:

- ``True``: metadata is requested, and passed to ``inverse_transform`` if provided. The request is ignored if metadata is not provided.

- ``False``: metadata is not requested and the meta-estimator will not pass it to ``inverse_transform``.

- ``None``: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

- ``str``: metadata should be passed to the meta-estimator with this given alias instead of the original name.

The default (``sklearn.utils.metadata_routing.UNCHANGED``) retains the
existing request. This allows you to change the request for some
parameters and not others.

.. versionadded:: 1.3

.. note::
This method is only relevant if this estimator is used as a
sub-estimator of a meta-estimator, e.g. used inside a
:class:`~sklearn.pipeline.Pipeline`. Otherwise it has no effect.

Parameters

Returns


set_output(, transform=None)*

Set output container.

See :ref:`sphx_glr_auto_examples_miscellaneous_plot_set_output.py`
for an example on how to use the API.

Parameters

Returns


set_params(params)

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects
(such as :class:`~sklearn.pipeline.Pipeline`). The latter have
parameters of the form ``<component>__<parameter>`` so that it's
possible to update each component of a nested object.

Parameters

Returns


set_transform_request(self: mlxtend.preprocessing.transactionencoder.TransactionEncoder, , sparse: Union[bool, NoneType, str] = '$UNCHANGED$') -> mlxtend.preprocessing.transactionencoder.TransactionEncoder*

Request metadata passed to the transform method.

Note that this method is only relevant if
``enable_metadata_routing=True`` (see :func:`sklearn.set_config`).
Please see :ref:`User Guide <metadata_routing>` on how the routing
mechanism works.

The options for each parameter are:

- ``True``: metadata is requested, and passed to ``transform`` if provided. The request is ignored if metadata is not provided.

- ``False``: metadata is not requested and the meta-estimator will not pass it to ``transform``.

- ``None``: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

- ``str``: metadata should be passed to the meta-estimator with this given alias instead of the original name.

The default (``sklearn.utils.metadata_routing.UNCHANGED``) retains the
existing request. This allows you to change the request for some
parameters and not others.

.. versionadded:: 1.3

.. note::
This method is only relevant if this estimator is used as a
sub-estimator of a meta-estimator, e.g. used inside a
:class:`~sklearn.pipeline.Pipeline`. Otherwise it has no effect.

Parameters

Returns


transform(X, sparse=False)

将交易转换为一维独热编码的NumPy数组.

Parameters

Returns

minmax_scaling

minmax_scaling(array, columns, min_val=0, max_val=1)

pandas DataFrame 的最小-最大缩放.

Parameters

Returns

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/preprocessing/minmax_scaling/

one_hot

one_hot(y, num_labels='auto', dtype='float')

类别标签的独热编码

Parameters

Returns

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/preprocessing/one_hot/

shuffle_arrays_unison

shuffle_arrays_unison(arrays, random_seed=None)

同步打乱 NumPy 数组.

Parameters

Returns

Examples

```
>>> import numpy as np
>>> from mlxtend.preprocessing import shuffle_arrays_unison
>>> X1 = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
>>> y1 = np.array([1, 2, 3])
>>> X2, y2 = shuffle_arrays_unison(arrays=[X1, y1], random_seed=3)
>>> assert(X2.all() == np.array([[4, 5, 6], [1, 2, 3], [7, 8, 9]]).all())
>>> assert(y2.all() == np.array([2, 1, 3]).all())
>>>

更多使用示例,请参见
https://rasbt.github.io/mlxtend/user_guide/preprocessing/shuffle_arrays_unison/

```

standardize

standardize(array, columns=None, ddof=0, return_params=False, params=None)

标准化 pandas DataFrame 中的列.

Parameters

Notes

如果给定列中的所有值都相同,则这些值都设置为 0.0.parameters 字典中的标准差因此设置为 1.0,以避免除以零.

Returns

Examples

有关使用示例,请参见 https://rasbt.github.io/mlxtend/user_guide/preprocessing/standardize/