File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -221,9 +221,8 @@ def __post_init__(self, transactions):
221221 if attribute .dtype != "cat" :
222222 feature_min = min_ [attribute .name ]
223223 feature_max = max_ [attribute .name ]
224- acc += (attribute .max_val - attribute .min_val ) / (
225- feature_max - feature_min
226- )
224+ acc += 1 if feature_max == feature_min \
225+ else (attribute .max_val - attribute .min_val ) / (feature_max - feature_min )
227226 contains_antecedent &= transactions [attribute .name ] <= attribute .max_val
228227 contains_antecedent &= transactions [attribute .name ] >= attribute .min_val
229228 else :
@@ -240,9 +239,8 @@ def __post_init__(self, transactions):
240239 if attribute .dtype != "cat" :
241240 feature_min = min_ [attribute .name ]
242241 feature_max = max_ [attribute .name ]
243- acc += (attribute .max_val - attribute .min_val ) / (
244- feature_max - feature_min
245- )
242+ acc += 1 if feature_max == feature_min \
243+ else (attribute .max_val - attribute .min_val ) / (feature_max - feature_min )
246244 contains_consequent &= transactions [attribute .name ] <= attribute .max_val
247245 contains_consequent &= transactions [attribute .name ] >= attribute .min_val
248246 else :
You can’t perform that action at this time.
0 commit comments