Skip to content

Commit 472b1e3

Browse files
authored
Merge pull request #332 from rasbt/transactionarray
TransactionEncoder
2 parents 77c57d5 + f31a56c commit 472b1e3

File tree

10 files changed

+387
-376
lines changed

10 files changed

+387
-376
lines changed

docs/mkdocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ pages:
105105
- user_guide/preprocessing/MeanCenterer.md
106106
- user_guide/preprocessing/minmax_scaling.md
107107
- user_guide/preprocessing/one-hot_encoding.md
108-
- user_guide/preprocessing/OnehotTransactions.md
109108
- user_guide/preprocessing/shuffle_arrays_unison.md
110109
- user_guide/preprocessing/standardize.md
110+
- user_guide/preprocessing/TransactionEncoder.md
111111
- regressor:
112112
- user_guide/regressor/LinearRegression.md
113113
- user_guide/regressor/StackingCVRegressor.md

docs/sources/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ The CHANGELOG for the current development version is available at
3333
- The `plot_decision_regions` function now automatically determines the optimal setting based on the feature dimensions and supports anti-aliasing. The old `res` parameter has been deprecated. ([#309](https://github.com/rasbt/mlxtend/pull/309) by [Guillaume Poirier-Morency](https://github.com/arteymix))
3434
- Apriori code is faster due to optimization in `onehot transformation` and the amount of candidates generated by the `apriori` algorithm. ([#327](https://github.com/rasbt/mlxtend/pull/327) by [Jakub Smid](https://github.com/jaksmid))
3535
- The `OnehotTransactions` class (which is typically often used in combination with the `apriori` function for association rule mining) is now more memory efficient as it uses boolean arrays instead of integer arrays. In addition, the `OnehotTransactions` class can be now be provided with `sparse` argument to generate sparse representations of the `onehot` matrix to further improve memory efficiency. ([#328](https://github.com/rasbt/mlxtend/pull/328) by [Jakub Smid](https://github.com/jaksmid))
36+
- The `OneHotTransactions` has been deprecated and replaced by the `TransactionEncoder` ([#332](https://github.com/rasbt/mlxtend/pull/332)
3637

3738
##### Bug Fixes
3839

docs/sources/USER_GUIDE_INDEX.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@
8585
- [MeanCenterer](user_guide/preprocessing/MeanCenterer.md)
8686
- [minmax_scaling](user_guide/preprocessing/minmax_scaling.md)
8787
- [one-hot_encoding](user_guide/preprocessing/one-hot_encoding.md)
88-
- [OnehotTransactions](user_guide/preprocessing/OnehotTransactions.md)
8988
- [shuffle_arrays_unison](user_guide/preprocessing/shuffle_arrays_unison.md)
9089
- [standardize](user_guide/preprocessing/standardize.md)
90+
- [TransactionEncoder](user_guide/preprocessing/TransactionEncoder.md)
9191

9292
## `regressor`
9393
- [LinearRegression](user_guide/regressor/LinearRegression.md)

docs/sources/user_guide/frequent_patterns/apriori.ipynb

+8-8
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"cell_type": "markdown",
7979
"metadata": {},
8080
"source": [
81-
"We can transform it into the right format via the `OnehotTransactions` encoder as follows:"
81+
"We can transform it into the right format via the `TransactionEncoder` as follows:"
8282
]
8383
},
8484
{
@@ -218,11 +218,11 @@
218218
],
219219
"source": [
220220
"import pandas as pd\n",
221-
"from mlxtend.preprocessing import OnehotTransactions\n",
221+
"from mlxtend.preprocessing import TransactionEncoder\n",
222222
"\n",
223-
"oht = OnehotTransactions()\n",
224-
"oht_ary = oht.fit(dataset).transform(dataset)\n",
225-
"df = pd.DataFrame(oht_ary, columns=oht.columns_)\n",
223+
"te = TransactionEncoder()\n",
224+
"te_ary = te.fit(dataset).transform(dataset)\n",
225+
"df = pd.DataFrame(te_ary, columns=te.columns_)\n",
226226
"df"
227227
]
228228
},
@@ -827,8 +827,8 @@
827827
}
828828
],
829829
"source": [
830-
"oht_ary = oht.fit(dataset).transform(dataset, sparse=True)\n",
831-
"sparse_df = pd.SparseDataFrame(oht_ary, columns=oht.columns_, default_fill_value=False)\n",
830+
"oht_ary = te.fit(dataset).transform(dataset, sparse=True)\n",
831+
"sparse_df = pd.SparseDataFrame(te_ary, columns=te.columns_, default_fill_value=False)\n",
832832
"sparse_df"
833833
]
834834
},
@@ -1034,7 +1034,7 @@
10341034
"name": "python",
10351035
"nbconvert_exporter": "python",
10361036
"pygments_lexer": "ipython3",
1037-
"version": "3.6.3"
1037+
"version": "3.6.4"
10381038
}
10391039
},
10401040
"nbformat": 4,

0 commit comments

Comments
 (0)