From 45cb6cd5d86fcd037107e318225d722bd98d5668 Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Sun, 24 Mar 2024 19:40:34 -0500 Subject: [PATCH 01/18] modified: test_transactionencoder.py - Added two new tests, `test_get_feature_names_out` and `test_set_output`. Passing these tests is a step towards the output of `TransactionEncoder` being formatted as a pandas.DataFramed by default. --- .../preprocessing/tests/test_transactionencoder.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mlxtend/preprocessing/tests/test_transactionencoder.py b/mlxtend/preprocessing/tests/test_transactionencoder.py index f5afd07e7..8b98fefd1 100644 --- a/mlxtend/preprocessing/tests/test_transactionencoder.py +++ b/mlxtend/preprocessing/tests/test_transactionencoder.py @@ -93,3 +93,15 @@ def test_cloning(): trans = oht2.fit_transform(dataset) np.testing.assert_array_equal(expect, trans) + + +def test_get_feature_names_out(): + """Assert TransactionEncoder has attribute get_feature_names_out.""" + oht = TransactionEncoder() + assert hasattr(oht, "get_feature_names_out") + + +def test_set_output(): + """Assert TransactionEncoder has attribute set_output.""" + oht = TransactionEncoder() + assert hasattr(oht, "set_output") From 943457534788862512cc6d28d41963019b23c4b5 Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Sun, 24 Mar 2024 20:48:53 -0500 Subject: [PATCH 02/18] modified: transactionencoder.py - Added `get_feature_names_out` method to `TransactionEncoder` to expose the `set_output` method. --- mlxtend/preprocessing/transactionencoder.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mlxtend/preprocessing/transactionencoder.py b/mlxtend/preprocessing/transactionencoder.py index bfb8a0035..0547a4d0a 100644 --- a/mlxtend/preprocessing/transactionencoder.py +++ b/mlxtend/preprocessing/transactionencoder.py @@ -181,3 +181,15 @@ def inverse_transform(self, array): def fit_transform(self, X, sparse=False): """Fit a TransactionEncoder encoder and transform a dataset.""" return self.fit(X).transform(X, sparse=sparse) + + def get_feature_names_out(self, input_features=None): + """Used to get the column names of pandas output. + + This method combined with the TransformerMixin exposes the + set_output API to the TransactionEncoder. This allows the user + to set the transformed output to a pandas.DataFrame by default. + + See https://scikit-learn.org/stable/developers/develop.html#developer-api-set-output + for more details. + """ + ... From b21bb21e8461225f455e8ea19c5f9cb948e16f29 Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Sun, 24 Mar 2024 20:53:14 -0500 Subject: [PATCH 03/18] modified: tests/test_transactionencoder.py - Updated test to include more checks. It is now back in a failing state. --- .../preprocessing/tests/test_transactionencoder.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mlxtend/preprocessing/tests/test_transactionencoder.py b/mlxtend/preprocessing/tests/test_transactionencoder.py index 8b98fefd1..f436d5e7b 100644 --- a/mlxtend/preprocessing/tests/test_transactionencoder.py +++ b/mlxtend/preprocessing/tests/test_transactionencoder.py @@ -5,6 +5,7 @@ # License: BSD 3 clause import numpy as np +import pandas as pd from scipy.sparse import csr_matrix from sklearn.base import clone @@ -102,6 +103,15 @@ def test_get_feature_names_out(): def test_set_output(): - """Assert TransactionEncoder has attribute set_output.""" + """Assert TransactionEncoder has attribute set_output. + + When configured, the transformed output of TransactionEncoder + should be a pandas.DataFrame with the correct column names and the + values should match those of the original numpy.array. + """ oht = TransactionEncoder() assert hasattr(oht, "set_output") + oht = oht.set_output(transform="pandas") + out = oht.fit_transform(dataset) + assert isinstance(out, pd.DataFrame) + assert out.columns.to_list() == oht.columns_ From 1a02dd5aa8c935f65b3951024c6e75cf86fa081b Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Sun, 24 Mar 2024 21:17:57 -0500 Subject: [PATCH 04/18] modified: tests/test_transactionencoder.py - Updated test_set_output docstring to be more explicit. - Added numpy assertion to check that the transformed output columns match the original columns_ attribute for test_set_output. - Added numpy assertion to check that the get_feature_names_out output match the original columns_ attribute for test_get_feature_names_out. --- .../preprocessing/tests/test_transactionencoder.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mlxtend/preprocessing/tests/test_transactionencoder.py b/mlxtend/preprocessing/tests/test_transactionencoder.py index f436d5e7b..8cc7fd6e4 100644 --- a/mlxtend/preprocessing/tests/test_transactionencoder.py +++ b/mlxtend/preprocessing/tests/test_transactionencoder.py @@ -100,18 +100,21 @@ def test_get_feature_names_out(): """Assert TransactionEncoder has attribute get_feature_names_out.""" oht = TransactionEncoder() assert hasattr(oht, "get_feature_names_out") + oht.fit(dataset) + np.testing.assert_array_equal(oht.get_feature_names_out(), oht.columns_) def test_set_output(): """Assert TransactionEncoder has attribute set_output. - When configured, the transformed output of TransactionEncoder - should be a pandas.DataFrame with the correct column names and the - values should match those of the original numpy.array. + When transform="pandas", the transformed output of + TransactionEncoder should be a pandas.DataFrame with the correct + column names and the values should match those of the original + numpy.array. """ oht = TransactionEncoder() assert hasattr(oht, "set_output") oht = oht.set_output(transform="pandas") out = oht.fit_transform(dataset) assert isinstance(out, pd.DataFrame) - assert out.columns.to_list() == oht.columns_ + np.testing.assert_array_equal(out.columns, oht.columns_) From 0167c8f59a890982bfbfa88352cb0ac3875a8bd9 Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Sun, 24 Mar 2024 21:20:40 -0500 Subject: [PATCH 05/18] modified: transactionencoder.py - Added logic similar to that in `sklearn.base.ClassNamePrefixFeaturesOutMixin` and `sklearn.base.OneToOneFeatureMixin` for the get_feature_names_out method. --- mlxtend/preprocessing/transactionencoder.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mlxtend/preprocessing/transactionencoder.py b/mlxtend/preprocessing/transactionencoder.py index 0547a4d0a..686e879ae 100644 --- a/mlxtend/preprocessing/transactionencoder.py +++ b/mlxtend/preprocessing/transactionencoder.py @@ -7,6 +7,7 @@ import numpy as np from scipy.sparse import csr_matrix from sklearn.base import BaseEstimator, TransformerMixin +from sklearn.utils.validation import check_is_fitted, _check_feature_names_in class TransactionEncoder(BaseEstimator, TransformerMixin): @@ -182,7 +183,7 @@ def fit_transform(self, X, sparse=False): """Fit a TransactionEncoder encoder and transform a dataset.""" return self.fit(X).transform(X, sparse=sparse) - def get_feature_names_out(self, input_features=None): + def get_feature_names_out(self): """Used to get the column names of pandas output. This method combined with the TransformerMixin exposes the @@ -192,4 +193,5 @@ def get_feature_names_out(self, input_features=None): See https://scikit-learn.org/stable/developers/develop.html#developer-api-set-output for more details. """ - ... + check_is_fitted(self, attributes="columns_") + return _check_feature_names_in(estimator=self, input_features=self.columns_) From 35dbeef60de441609d3c0d1d21d6c928e7c16daf Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Sun, 24 Mar 2024 22:01:45 -0500 Subject: [PATCH 06/18] modified: docs/sources/user_guide/preprocessing/TransactionEncoder.ipynb - Updated the user guide to show both the get_feature_names_out method and the set_output method. --- .../preprocessing/TransactionEncoder.ipynb | 114 ++++++++++-------- 1 file changed, 65 insertions(+), 49 deletions(-) diff --git a/docs/sources/user_guide/preprocessing/TransactionEncoder.ipynb b/docs/sources/user_guide/preprocessing/TransactionEncoder.ipynb index fe84cee9d..01e2db775 100644 --- a/docs/sources/user_guide/preprocessing/TransactionEncoder.ipynb +++ b/docs/sources/user_guide/preprocessing/TransactionEncoder.ipynb @@ -89,7 +89,7 @@ " [False, False, True, True, True, True],\n", " [False, False, True, False, True, True],\n", " [False, False, True, False, True, False],\n", - " [ True, True, False, False, False, False]], dtype=bool)" + " [ True, True, False, False, False, False]])" ] }, "execution_count": 2, @@ -141,7 +141,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "After fitting, the unique column names that correspond to the data array shown above can be accessed via the `columns_` attribute:" + "After fitting, the unique column names that correspond to the data array shown above can be accessed via the `columns_` attribute, or the `get_feature_names_out` method:" ] }, { @@ -161,19 +161,71 @@ } ], "source": [ - "te.columns_" + "te.columns_ # list of strings" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array(['Apple', 'Bananas', 'Beer', 'Chicken', 'Milk', 'Rice'],\n", + " dtype=object)" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "te.get_feature_names_out() # numpy.array of strings (objects)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "For our convenience, we can turn theencoded array into a pandas `DataFrame`:" + "If we desire, we can turn the one-hot encoded array back into a transaction list of lists via the `inverse_transform` function:" ] }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[['Apple', 'Beer', 'Chicken', 'Rice'],\n", + " ['Apple', 'Beer', 'Rice'],\n", + " ['Apple', 'Beer'],\n", + " ['Apple', 'Bananas']]" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "first4 = te_ary[:4]\n", + "te.inverse_transform(first4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For our convenience, we can set the default output to a pandas `DataFrame` with the `set_output` method:" + ] + }, + { + "cell_type": "code", + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -294,46 +346,15 @@ "7 True True False False False False" ] }, - "execution_count": 5, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "import pandas as pd\n", - "\n", - "pd.DataFrame(te_ary, columns=te.columns_)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "If we desire, we can turn the one-hot encoded array back into a transaction list of lists via the `inverse_transform` function:" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[['Apple', 'Beer', 'Chicken', 'Rice'],\n", - " ['Apple', 'Beer', 'Rice'],\n", - " ['Apple', 'Beer'],\n", - " ['Apple', 'Bananas']]" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "first4 = te_ary[:4]\n", - "te.inverse_transform(first4)" + "te = TransactionEncoder().set_output(transform=\"pandas\")\n", + "te_df = te.fit(dataset).transform(dataset)\n", + "te_df" ] }, { @@ -346,7 +367,9 @@ { "cell_type": "code", "execution_count": 3, - "metadata": {}, + "metadata": { + "scrolled": true + }, "outputs": [ { "name": "stdout", @@ -545,13 +568,6 @@ "with open('../../api_modules/mlxtend.preprocessing/TransactionEncoder.md', 'r') as f:\n", " print(f.read())" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { @@ -571,7 +587,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.7" + "version": "3.11.7" }, "toc": { "nav_menu": {}, From 1c4d3284f29112457cbcd7548f3bb2483a6fa81f Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Sun, 24 Mar 2024 22:13:30 -0500 Subject: [PATCH 07/18] modified: docs/sources/CHANGELOG.md - Updated changelog to reflect new features. --- docs/sources/CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/sources/CHANGELOG.md b/docs/sources/CHANGELOG.md index a82d4e459..7fcff9615 100755 --- a/docs/sources/CHANGELOG.md +++ b/docs/sources/CHANGELOG.md @@ -6,6 +6,20 @@ The CHANGELOG for the current development version is available at [https://github.com/rasbt/mlxtend/blob/master/docs/sources/CHANGELOG.md](https://github.com/rasbt/mlxtend/blob/master/docs/sources/CHANGELOG.md). --- +### Version 0.23.2 (TBD) + +##### Downloads + +- [Source code (zip)](https://github.com/rasbt/mlxtend/archive/v0.23.2.zip) + +- [Source code (tar.gz)](https://github.com/rasbt/mlxtend/archive/v0.23.2.tar.gz) + +##### New Features and Enhancements + +- Integrated scikit-learn's `set_output` method into `TransactionEncoder` ([#1081](https://github.com/rasbt/mlxtend/issues/1085) via [it176131](https://github.com/it176131)) + + + ### Version 0.23.1 (5 Jan 2024) From 3f5496cce31fec9860e13d6d05c6687476ed98cd Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Sun, 24 Mar 2024 22:20:54 -0500 Subject: [PATCH 08/18] modified: docs/sources/CHANGELOG.md - Updated issue number. --- docs/sources/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/CHANGELOG.md b/docs/sources/CHANGELOG.md index 7fcff9615..b2ca768d9 100755 --- a/docs/sources/CHANGELOG.md +++ b/docs/sources/CHANGELOG.md @@ -16,7 +16,7 @@ The CHANGELOG for the current development version is available at ##### New Features and Enhancements -- Integrated scikit-learn's `set_output` method into `TransactionEncoder` ([#1081](https://github.com/rasbt/mlxtend/issues/1085) via [it176131](https://github.com/it176131)) +- Integrated scikit-learn's `set_output` method into `TransactionEncoder` ([#1085](https://github.com/rasbt/mlxtend/issues/1085) via [it176131](https://github.com/it176131)) From 3ecb7112c5db6678e635ab691d5e9d7e281a3198 Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Sun, 24 Mar 2024 22:26:08 -0500 Subject: [PATCH 09/18] modified: docs/sources/CHANGELOG.md - Updated issue number (again) to reflect the PR link instead of the issue link. --- docs/sources/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/CHANGELOG.md b/docs/sources/CHANGELOG.md index b2ca768d9..d3e5dec21 100755 --- a/docs/sources/CHANGELOG.md +++ b/docs/sources/CHANGELOG.md @@ -16,7 +16,7 @@ The CHANGELOG for the current development version is available at ##### New Features and Enhancements -- Integrated scikit-learn's `set_output` method into `TransactionEncoder` ([#1085](https://github.com/rasbt/mlxtend/issues/1085) via [it176131](https://github.com/it176131)) +- Integrated scikit-learn's `set_output` method into `TransactionEncoder` ([#1087](https://github.com/rasbt/mlxtend/issues/1087) via [it176131](https://github.com/it176131)) From 8c0ca72045abadef7849ed1f52d9c23efa734a33 Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Mon, 25 Mar 2024 20:39:02 -0500 Subject: [PATCH 10/18] modified: mlxtend/preprocessing/transactionencoder.py - Ran isort over imports to fix failing check in PR. --- mlxtend/preprocessing/transactionencoder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlxtend/preprocessing/transactionencoder.py b/mlxtend/preprocessing/transactionencoder.py index 686e879ae..153af5a2c 100644 --- a/mlxtend/preprocessing/transactionencoder.py +++ b/mlxtend/preprocessing/transactionencoder.py @@ -7,7 +7,7 @@ import numpy as np from scipy.sparse import csr_matrix from sklearn.base import BaseEstimator, TransformerMixin -from sklearn.utils.validation import check_is_fitted, _check_feature_names_in +from sklearn.utils.validation import _check_feature_names_in, check_is_fitted class TransactionEncoder(BaseEstimator, TransformerMixin): From 2931b7a07d01a472dc6a02b64a979ae6f04eb342 Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Mon, 25 Mar 2024 20:44:40 -0500 Subject: [PATCH 11/18] modified: requirements.txt - Increased scikit-learn version to minimum required for set_output to work. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 20f546a59..63747afd9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ scipy>=1.2.1 numpy>=1.16.2 pandas>=0.24.2 -scikit-learn>=1.0.2 +scikit-learn>=1.2.2 matplotlib>=3.0.0 joblib>=0.13.2 \ No newline at end of file From 96e2a36a02f6009e3504ed4cd83df6856099944c Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Thu, 28 Mar 2024 21:20:41 -0500 Subject: [PATCH 12/18] modified: environment.yml - Bumped scikit-learn version up to 1.2.2 to match requirements.txt. --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index e03bd2c58..d63372b60 100644 --- a/environment.yml +++ b/environment.yml @@ -7,7 +7,7 @@ dependencies: - pandas>=1.3.4 - pip>=21.3.1 - pytest>=6.2.5 - - scikit-learn>=1.0.1 + - scikit-learn>=1.2.2 - scipy>=1.7.3 - setuptools>=59.4.0 - pip: From 09d9f2411c55b8cfd9efc07f6d75edd400096c5b Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Thu, 28 Mar 2024 21:21:46 -0500 Subject: [PATCH 13/18] modified: .github/workflows/python-package-conda.yml - Bumped scikit-learn version up to 1.2.2 to match environment.yml and requirements.txt. --- .github/workflows/python-package-conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 72b7191e5..d2f4b6d3a 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -31,7 +31,7 @@ jobs: conda install tensorflow joblib pytest -y -q conda install imageio scikit-image -y -q conda install dlib -y -q - pip install scikit-learn==1.1.3 pandas==1.3.5 markdown coverage + pip install scikit-learn==1.2.2 pandas==1.3.5 markdown coverage pip install -e . python -c "import numpy; print('NumPy:', numpy.__version__)" python -c "import scipy; print('SciPy:', scipy.__version__)" From 833d31e2d521fa8fda0e227c1c71e89b229fbf48 Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Thu, 28 Mar 2024 21:53:58 -0500 Subject: [PATCH 14/18] modified: mlxtend/preprocessing/tests/test_transactionencoder.py - Updated `test_inverse_transform` to passing state by removing conversion to numpy array. --- mlxtend/preprocessing/tests/test_transactionencoder.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mlxtend/preprocessing/tests/test_transactionencoder.py b/mlxtend/preprocessing/tests/test_transactionencoder.py index 8cc7fd6e4..7a7d0d771 100644 --- a/mlxtend/preprocessing/tests/test_transactionencoder.py +++ b/mlxtend/preprocessing/tests/test_transactionencoder.py @@ -79,9 +79,7 @@ def test_fit_transform(): def test_inverse_transform(): oht = TransactionEncoder() oht.fit(dataset) - np.testing.assert_array_equal( - np.array(data_sorted), np.array(oht.inverse_transform(expect)) - ) + assert data_sorted == oht.inverse_transform(expect) def test_cloning(): From 7cfd45b621f63111c2697a0f661c66db634ddf35 Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Thu, 28 Mar 2024 23:24:59 -0500 Subject: [PATCH 15/18] modified: .github/workflows/python-package-conda.yml - Updated scikit-learn version to 1.3.1 to integerate fix from https://github.com/scikit-learn/scikit-learn/pull/27044 modified: environment.yml - Updated scikit-learn version to 1.3.1 to integerate fix from https://github.com/scikit-learn/scikit-learn/pull/27044 modified: requirements.txt - Updated scikit-learn version to 1.3.1 to integerate fix from https://github.com/scikit-learn/scikit-learn/pull/27044 --- .github/workflows/python-package-conda.yml | 2 +- environment.yml | 2 +- requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index d2f4b6d3a..fd29dc19c 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -31,7 +31,7 @@ jobs: conda install tensorflow joblib pytest -y -q conda install imageio scikit-image -y -q conda install dlib -y -q - pip install scikit-learn==1.2.2 pandas==1.3.5 markdown coverage + pip install scikit-learn==1.3.1 pandas==1.3.5 markdown coverage pip install -e . python -c "import numpy; print('NumPy:', numpy.__version__)" python -c "import scipy; print('SciPy:', scipy.__version__)" diff --git a/environment.yml b/environment.yml index d63372b60..547787efd 100644 --- a/environment.yml +++ b/environment.yml @@ -7,7 +7,7 @@ dependencies: - pandas>=1.3.4 - pip>=21.3.1 - pytest>=6.2.5 - - scikit-learn>=1.2.2 + - scikit-learn>=1.3.1 - scipy>=1.7.3 - setuptools>=59.4.0 - pip: diff --git a/requirements.txt b/requirements.txt index 63747afd9..89d9d9c48 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ scipy>=1.2.1 numpy>=1.16.2 pandas>=0.24.2 -scikit-learn>=1.2.2 +scikit-learn>=1.3.1 matplotlib>=3.0.0 joblib>=0.13.2 \ No newline at end of file From f059ab7549e31ceba15d199eb617098bf4de87d1 Mon Sep 17 00:00:00 2001 From: Sebastian Raschka Date: Sat, 30 Mar 2024 14:05:17 -0500 Subject: [PATCH 16/18] Update mlxtend/preprocessing/transactionencoder.py --- mlxtend/preprocessing/transactionencoder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlxtend/preprocessing/transactionencoder.py b/mlxtend/preprocessing/transactionencoder.py index 153af5a2c..82a1acb7e 100644 --- a/mlxtend/preprocessing/transactionencoder.py +++ b/mlxtend/preprocessing/transactionencoder.py @@ -186,7 +186,7 @@ def fit_transform(self, X, sparse=False): def get_feature_names_out(self): """Used to get the column names of pandas output. - This method combined with the TransformerMixin exposes the + This method combined with the `TransformerMixin` exposes the set_output API to the TransactionEncoder. This allows the user to set the transformed output to a pandas.DataFrame by default. From bf012d7fa45c2ab3825dacf7329438f8ff33656d Mon Sep 17 00:00:00 2001 From: Sebastian Raschka Date: Sat, 30 Mar 2024 14:05:21 -0500 Subject: [PATCH 17/18] Update mlxtend/preprocessing/transactionencoder.py --- mlxtend/preprocessing/transactionencoder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlxtend/preprocessing/transactionencoder.py b/mlxtend/preprocessing/transactionencoder.py index 82a1acb7e..5b91307fd 100644 --- a/mlxtend/preprocessing/transactionencoder.py +++ b/mlxtend/preprocessing/transactionencoder.py @@ -187,7 +187,7 @@ def get_feature_names_out(self): """Used to get the column names of pandas output. This method combined with the `TransformerMixin` exposes the - set_output API to the TransactionEncoder. This allows the user + set_output API to the `TransactionEncoder`. This allows the user to set the transformed output to a pandas.DataFrame by default. See https://scikit-learn.org/stable/developers/develop.html#developer-api-set-output From 44961b56e73a2150c958e0517d392153b4ac1029 Mon Sep 17 00:00:00 2001 From: Sebastian Raschka Date: Sat, 30 Mar 2024 14:05:27 -0500 Subject: [PATCH 18/18] Update mlxtend/preprocessing/transactionencoder.py --- mlxtend/preprocessing/transactionencoder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlxtend/preprocessing/transactionencoder.py b/mlxtend/preprocessing/transactionencoder.py index 5b91307fd..55c4dffc6 100644 --- a/mlxtend/preprocessing/transactionencoder.py +++ b/mlxtend/preprocessing/transactionencoder.py @@ -188,7 +188,7 @@ def get_feature_names_out(self): This method combined with the `TransformerMixin` exposes the set_output API to the `TransactionEncoder`. This allows the user - to set the transformed output to a pandas.DataFrame by default. + to set the transformed output to a `pandas.DataFrame` by default. See https://scikit-learn.org/stable/developers/develop.html#developer-api-set-output for more details.