PAMI - An Open Source PAttern MIning Python Library

PAMI is a Python library containing 100+ algorithms to discover useful patterns in various databases across multiple computing platforms. (Active)

<– Return to home page

Inputs and ouputs of an algorithm in PAMI

Inputs

When you are writing algorithms for PAMI, please ensure the following:

  1. Dataset
    • text file or
    • data frame

      The data frame will contain multiple rows but only single column. In text file or data frame, items are seperated by a seperator.

  2. Algorithm specific constraints. For example, minimum support, maximum periodicity, and top-k.

Outputs

The algorithm developers were requested to ensure the following output methods exist:

  1. save(): function must exist to save the generated patterns in a file.
  2. getPatternsAsDataFrame(): function that outputs the generated patterns into a data frame
  3. getMemoryUSS(): function must output the USS memory consumed by a program.
  4. getMemoryRSS(): function must output the RSS memory consumed by a program.
  5. getRuntime(): function must output the runtime consumed by a program.
  6. printResults(): function must print the results of a program. This function is provided below.
  7. getCandidatePatterns(): returns a list of distinct, explicitly generated candidates from the latest mining run, including rejected candidates. Use len(obj.getCandidatePatterns()) for the candidate count, just as len(obj.getPatterns()) counts final patterns. Candidates use immutable representations; their format depends on the algorithm. The list is empty before mining and for pattern growth algorithms without explicit candidate generation, such as FP Growth and PrefixSpan. Retaining candidates requires additional memory; this count is not the number of support tests or search nodes.
obj.mine()
patterns = obj.getPatterns()
candidates = obj.getCandidatePatterns()
print("Final patterns:", len(patterns))
print("Candidate patterns:", len(candidates))
def printResults(self):
    print("Total number of Frequent Patterns:", len(self.getPatterns()))
    print("Total Memory in USS:", self.getMemoryUSS())
    print("Total Memory in RSS", self.getMemoryRSS())
    print("Total ExecutionTime in ms:", self.getRuntime())