Skip to content

Commit

Permalink
Merge pull request #1000 from tkellogg/master
Browse files Browse the repository at this point in the history
Fix fpmax for sparse matrices
  • Loading branch information
rasbt committed Dec 3, 2022
2 parents f248eb6 + 29c97c0 commit 0a4013e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/sources/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Version 0.22.0dev (TBD)
##### New Features and Enhancements

- The `mlxtend.frequent_patterns.association_rules` function has a new metric - Zhangs Metric, which measures both association and dissociation. ([#980](https://github.com/rasbt/mlxtend/pull/980))

- Internal `fpmax` code improvement that avoids casting a sparse DataFrame into a dense NumPy array. ([#1000](https://github.com/rasbt/mlxtend/pull/1000) via [Tim Kellogg](https://github.com/tkellogg))

### Version 0.21.0 (09/17/2022)

Expand Down
4 changes: 2 additions & 2 deletions mlxtend/frequent_patterns/fpmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ def fpmax(df, min_support=0.5, use_colnames=False, max_len=None, verbose=0):

tree, rank = fpc.setup_fptree(df, min_support)

minsup = math.ceil(min_support * len(df.values)) # min support as count
minsup = math.ceil(min_support * len(df)) # min support as count
generator = fpmax_step(tree, minsup, MFITree(rank), colname_map, max_len, verbose)

return fpc.generate_itemsets(generator, len(df.values), colname_map)
return fpc.generate_itemsets(generator, len(df), colname_map)


def fpmax_step(tree, minsup, mfit, colnames, max_len, verbose):
Expand Down

0 comments on commit 0a4013e

Please sign in to comment.