File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -100,14 +100,18 @@ def test_gsp_support_monotonicity(transactions: List[List[str]]) -> None:
100100 If we decrease the minimum support threshold, we should get
101101 at least as many patterns (or more) than with a higher threshold.
102102 """
103- gsp = GSP (transactions )
103+ # Use separate GSP instances to avoid state accumulation between searches
104+ # on different min_support thresholds.
104105
105106 # Test with two different support levels
106107 high_support = 0.5
107108 low_support = 0.2
108109
109- result_high = gsp .search (min_support = high_support )
110- result_low = gsp .search (min_support = low_support )
110+ gsp_high = GSP (transactions )
111+ gsp_low = GSP (transactions )
112+
113+ result_high = gsp_high .search (min_support = high_support )
114+ result_low = gsp_low .search (min_support = low_support )
111115
112116 # Count total patterns at each support level
113117 patterns_high = sum (len (level ) for level in result_high )
You can’t perform that action at this time.
0 commit comments