Skip to content

Commit

Permalink
Merge pull request #332 from rasbt/transactionarray
Browse files Browse the repository at this point in the history
TransactionEncoder
  • Loading branch information
rasbt committed Feb 19, 2018
2 parents 77c57d5 + f31a56c commit 472b1e3
Show file tree
Hide file tree
Showing 10 changed files with 387 additions and 376 deletions.
2 changes: 1 addition & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ pages:
- user_guide/preprocessing/MeanCenterer.md
- user_guide/preprocessing/minmax_scaling.md
- user_guide/preprocessing/one-hot_encoding.md
- user_guide/preprocessing/OnehotTransactions.md
- user_guide/preprocessing/shuffle_arrays_unison.md
- user_guide/preprocessing/standardize.md
- user_guide/preprocessing/TransactionEncoder.md
- regressor:
- user_guide/regressor/LinearRegression.md
- user_guide/regressor/StackingCVRegressor.md
Expand Down
1 change: 1 addition & 0 deletions docs/sources/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ The CHANGELOG for the current development version is available at
- 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))
- 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))
- 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))
- The `OneHotTransactions` has been deprecated and replaced by the `TransactionEncoder` ([#332](https://github.com/rasbt/mlxtend/pull/332)

##### Bug Fixes

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/USER_GUIDE_INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@
- [MeanCenterer](user_guide/preprocessing/MeanCenterer.md)
- [minmax_scaling](user_guide/preprocessing/minmax_scaling.md)
- [one-hot_encoding](user_guide/preprocessing/one-hot_encoding.md)
- [OnehotTransactions](user_guide/preprocessing/OnehotTransactions.md)
- [shuffle_arrays_unison](user_guide/preprocessing/shuffle_arrays_unison.md)
- [standardize](user_guide/preprocessing/standardize.md)
- [TransactionEncoder](user_guide/preprocessing/TransactionEncoder.md)

## `regressor`
- [LinearRegression](user_guide/regressor/LinearRegression.md)
Expand Down
16 changes: 8 additions & 8 deletions docs/sources/user_guide/frequent_patterns/apriori.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We can transform it into the right format via the `OnehotTransactions` encoder as follows:"
"We can transform it into the right format via the `TransactionEncoder` as follows:"
]
},
{
Expand Down Expand Up @@ -218,11 +218,11 @@
],
"source": [
"import pandas as pd\n",
"from mlxtend.preprocessing import OnehotTransactions\n",
"from mlxtend.preprocessing import TransactionEncoder\n",
"\n",
"oht = OnehotTransactions()\n",
"oht_ary = oht.fit(dataset).transform(dataset)\n",
"df = pd.DataFrame(oht_ary, columns=oht.columns_)\n",
"te = TransactionEncoder()\n",
"te_ary = te.fit(dataset).transform(dataset)\n",
"df = pd.DataFrame(te_ary, columns=te.columns_)\n",
"df"
]
},
Expand Down Expand Up @@ -827,8 +827,8 @@
}
],
"source": [
"oht_ary = oht.fit(dataset).transform(dataset, sparse=True)\n",
"sparse_df = pd.SparseDataFrame(oht_ary, columns=oht.columns_, default_fill_value=False)\n",
"oht_ary = te.fit(dataset).transform(dataset, sparse=True)\n",
"sparse_df = pd.SparseDataFrame(te_ary, columns=te.columns_, default_fill_value=False)\n",
"sparse_df"
]
},
Expand Down Expand Up @@ -1034,7 +1034,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
"version": "3.6.4"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 472b1e3

Please sign in to comment.