From d00b364bf418f24b990c113980e01ee0899c7951 Mon Sep 17 00:00:00 2001 From: Tarun Sreepada Date: Thu, 2 May 2024 19:27:41 +0900 Subject: [PATCH] leverage bug fix --- PAMI/AssociationRules/basic/leverage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PAMI/AssociationRules/basic/leverage.py b/PAMI/AssociationRules/basic/leverage.py index 2cbf2e0d..3407f2a2 100644 --- a/PAMI/AssociationRules/basic/leverage.py +++ b/PAMI/AssociationRules/basic/leverage.py @@ -184,7 +184,7 @@ def _readPatterns(self): raise ValueError("Pattern should be a tuple. PAMI is going through a major revision. Please raise an issue in the github repository regarding this error and provide information regarding input and algorithm.\ In the meanwhile try saving the patterns to a file using (alg).save() and use the file as input. If that doesn't work, please raise an issue in the github repository.") s = tuple(sorted(pattern[i])) - self._frequentPatterns[s] = support[i] + self._frequentPatterns[s] = support[i] / self._maxTS if isinstance(self._iFile, str): if _ab._validators.url(self._iFile): f = _ab._urlopen(self._iFile) @@ -194,7 +194,7 @@ def _readPatterns(self): s = line[0].split(self._sep) s = tuple(sorted(s)) - self._frequentPatterns[s] = int(line[1]) + self._frequentPatterns[s] = int(line[1]) / self._maxTS else: try: with open(self._iFile, 'r', encoding='utf-8') as f: