Spaces:
Runtime error
Runtime error
File size: 1,255 Bytes
44504f7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
from knw import knw
class pattern_mining(knw):
def __init__(self):
super().__init__()
self.name = "pami"
self.description = "The pami library is a Python library for pattern mining. User can choose many algorithms like FP-growth algorithm."
self.core_function = "pami"
self.mode = 'full'
def pami(self):
return """
!pip install PAMI
from PAMI.frequentPattern.basic import FPGrowth as alg
fileURL = "https://u-aizu.ac.jp/~udayrage/datasets/transactionalDatabases/Transactional_T10I4D100K.csv"
minSup = 300
obj = alg.FPGrowth(iFile=fileURL, minSup=minSup, sep='\t') #here is sep='tab'
# obj.startMine() #deprecated
obj.mine()
obj.save('frequentPatternsAtMinSupCount300.txt')
frequentPatternsDF = obj.getPatternsAsDataFrame()
print('Total No of patterns: ' + str(len(frequentPatternsDF))) # print the total number of patterns
print('Runtime: ' + str(obj.getRuntime())) # measure the runtime
print('Memory (RSS): ' + str(obj.getMemoryRSS()))
print('Memory (USS): ' + str(obj.getMemoryUSS()))
"""
# if __name__ == '__main__':
# pami = pami()
# print(pami.get_core_function())
|