mirror of
https://github.com/apachecn/ailearning.git
synced 2026-02-12 23:05:14 +08:00
12 lines
314 B
Python
12 lines
314 B
Python
def loadDataSet():
|
|
return [[1,3,4],[2,3,5],[1,2,3,5],[2,5]]
|
|
def createC1(dataSet):
|
|
c1=[]
|
|
for transaction in dataSet:
|
|
for item in transaction:
|
|
if not [item] in c1:
|
|
c1.append([item])
|
|
c1.sort()
|
|
return map(frozenset,c1)
|
|
def scanD(D,ck,minSupport):
|
|
ssCnt = {} |