Skip to content

Commit

Permalink
Merge pull request #14 from lukassykora/fix/gpu-predict
Browse files Browse the repository at this point in the history
fix: predict method for cupy
  • Loading branch information
lukassykora authored Aug 4, 2024
2 parents 9599f99 + 1c39538 commit d0ca299
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,7 @@
## [1.0.3] - 2024-07-31

* Comparison with another package.

## [1.0.4] - 2024-07-04

* Fix predict method for cupy
6 changes: 3 additions & 3 deletions src/action_rules/candidates/candidate_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def get_support(
- Ensure that the `item` index is within the bounds of the frame's rows.
- For sparse matrices, the sum is computed efficiently by leveraging sparse matrix operations.
"""
return frame[item].sum()
return int(frame[item].sum())

def process_flexible_candidates(
self,
Expand Down Expand Up @@ -593,8 +593,8 @@ def process_items(
if self.in_stop_list(itemset_prefix + (item,), stop_list_itemset):
continue

undesired_support = undesired_frame[item].sum()
desired_support = desired_frame[item].sum()
undesired_support = self.get_support(undesired_frame, item)
desired_support = self.get_support(desired_frame, item)

if verbose:
print('SUPPORT for: ' + str(itemset_prefix + (item,)))
Expand Down

0 comments on commit d0ca299

Please sign in to comment.