PAMI.AssociationRules.basic package

Submodules

PAMI.AssociationRules.basic.ARWithConfidence module

class PAMI.AssociationRules.basic.ARWithConfidence.ARWithConfidence(iFile, minConf, sep)[source]

Bases: object

Description:

Association Rules are derived from frequent patterns using “confidence” metric.

Reference:

Parameters:
  • iFile – str : Name of the Input file to mine complete set of association rules

  • oFile – str : Name of the output file to store complete set of association rules

  • minConf – float : The user can specify the minConf in float between the range of 0 to 1.

  • sep – str : This variable is used to distinguish items from one another in a transaction. The default seperator is tab space. However, the users can override their default separator.

Attributes:
startTimefloat

To record the start time of the mining process

endTimefloat

To record the completion time of the mining process

finalPatternsdict

Storing the complete set of patterns in a dictionary variable

memoryUSSfloat

To store the total amount of USS memory consumed by the program

memoryRSSfloat

To store the total amount of RSS memory consumed by the program

Methods to execute code on terminal

Format:

(.venv) $ python3 ARWithConfidence.py <inputFile> <outputFile> <minConf> <sep>

Example Usage:

(.venv) $ python3 ARWithConfidence.py sampleDB.txt patterns.txt 0.5 ' '

Note

minConf will be considered only in 0 to 1.

Importing this algorithm into a python program

import PAMI.AssociationRules.basic import ARWithConfidence as alg

obj = alg.ARWithConfidence(iFile, minConf)

obj.mine()

associationRules = obj.getPatterns()

print("Total number of Association Rules:", len(associationRules))

obj.save(oFile)

Df = obj.getPatternInDataFrame()

memUSS = obj.getMemoryUSS()

print("Total Memory in USS:", memUSS)

memRSS = obj.getMemoryRSS()

print("Total Memory in RSS", memRSS)

run = obj.getRuntime()

print("Total ExecutionTime in seconds:", run)

Credits:

The complete program was written by P.Likhitha under the supervision of Professor Rage Uday Kiran.

getMemoryRSS()[source]

Total amount of RSS memory consumed by the mining process will be retrieved from this function :return: returning RSS memory consumed by the mining process :rtype: float

getMemoryUSS()[source]

Total amount of USS memory consumed by the mining process will be retrieved from this function :return: returning USS memory consumed by the mining process :rtype: float

getPatterns()[source]

Function to send the set of frequent patterns after completion of the mining process :return: returning frequent patterns :rtype: dict

getPatternsAsDataFrame()[source]

Storing final frequent patterns in a dataframe :return: returning frequent patterns in a dataframe :rtype: pd.DataFrame

getRuntime()[source]

Calculating the total amount of runtime taken by the mining process :return: returning total amount of runtime taken by the mining process :rtype: float

mine()[source]

Association rule mining process will start from here

printResults()[source]

Function to send the result after completion of the mining process

save(outFile)[source]

Complete set of frequent patterns will be loaded in to an output file :param outFile: name of the outputfile :type outFile: file

startMine()[source]

Association rule mining process will start from here

PAMI.AssociationRules.basic.ARWithLeverage module

class PAMI.AssociationRules.basic.ARWithLeverage.ARWithLeverage(iFile, minConf, sep)[source]

Bases: object

Description:

Association Rules are derived from frequent patterns using “leverage” metric.

Reference:

Parameters:
  • iFile – str : Name of the Input file to mine complete set of association rules

  • oFile – str : Name of the output file to store complete set of association rules

  • minConf – float : The user can specify the minConf in float between the range of 0 to 1.

  • sep – str : This variable is used to distinguish items from one another in a transaction. The default seperator is tab space. However, the users can override their default separator.

Attributes:
startTimefloat

To record the start time of the mining process

endTimefloat

To record the completion time of the mining process

finalPatternsdict

Storing the complete set of patterns in a dictionary variable

memoryUSSfloat

To store the total amount of USS memory consumed by the program

memoryRSSfloat

To store the total amount of RSS memory consumed by the program

Methods to execute code on terminal

Format:

(.venv) $ python3 ARWithLeverage.py <inputFile> <outputFile> <minConf> <sep>

Example Usage:

(.venv) $ python3 ARWithLeverage.py sampleDB.txt patterns.txt 10.0 ' '

Note

minConf will be considered only in 0 to 1.

Importing this algorithm into a python program

import PAMI.AssociationRules.basic import ARWithLeverage as alg

obj = alg.ARWithLeverage(iFile, minConf)

obj.mine()

associationRules = obj.getPatterns()

print("Total number of Association Rules:", len(associationRules))

obj.save(oFile)

Df = obj.getPatternInDataFrame()

memUSS = obj.getMemoryUSS()

print("Total Memory in USS:", memUSS)

memRSS = obj.getMemoryRSS()

print("Total Memory in RSS", memRSS)

run = obj.getRuntime()

print("Total ExecutionTime in seconds:", run)

Credits:

The complete program was written by P.Likhitha under the supervision of Professor Rage Uday Kiran.

getMemoryRSS() float[source]

Total amount of RSS memory consumed by the mining process will be retrieved from this function :return: returning RSS memory consumed by the mining process :rtype: float

getMemoryUSS() float[source]

Total amount of USS memory consumed by the mining process will be retrieved from this function :return: returning USS memory consumed by the mining process :rtype: float

getPatterns() dict[source]

Function to send the set of frequent patterns after completion of the mining process :return: returning frequent patterns :rtype: dict

getPatternsAsDataFrame() DataFrame[source]

Storing final frequent patterns in a dataframe :return: returning frequent patterns in a dataframe :rtype: pd.DataFrame

getRuntime() float[source]

Calculating the total amount of runtime taken by the mining process :return: returning total amount of runtime taken by the mining process :rtype: float

mine() None[source]

Association rule mining process will start from here

printResults() None[source]

Function to send the result after completion of the mining process

save(outFile) None[source]

Complete set of frequent patterns will be loaded in to an output file :param outFile: name of the outputfile :type outFile: file :return: None

startMine() None[source]

Association rule mining process will start from here

PAMI.AssociationRules.basic.ARWithLift module

class PAMI.AssociationRules.basic.ARWithLift.ARWithLift(iFile, minConf, sep)[source]

Bases: object

Description:

Association Rules are derived from frequent patterns using “lift” metric.

Reference:

Parameters:
  • iFile – str : Name of the Input file to mine complete set of association rules

  • oFile – str : Name of the output file to store complete set of association rules

  • minConf – float : The user can specify the minConf in float between the range of 0 to 1.

  • sep – str : This variable is used to distinguish items from one another in a transaction. The default seperator is tab space. However, the users can override their default separator.

Attributes:
startTimefloat

To record the start time of the mining process

endTimefloat

To record the completion time of the mining process

finalPatternsdict

Storing the complete set of patterns in a dictionary variable

memoryUSSfloat

To store the total amount of USS memory consumed by the program

memoryRSSfloat

To store the total amount of RSS memory consumed by the program

Methods to execute code on terminal

Format:

(.venv) $ python3 ARWithLift.py <inputFile> <outputFile> <minConf> <sep>

Example Usage:

(.venv) $ python3 ARWithLift.py sampleDB.txt patterns.txt 0.5 ' '

Note

minConf will be considered only in 0 to 1.

Importing this algorithm into a python program

import PAMI.AssociationRules.basic import ARWithLift as alg

obj = alg.ARWithLift(iFile, minConf)

obj.mine()

associationRules = obj.getPatterns()

print("Total number of Association Rules:", len(associationRules))

obj.save(oFile)

Df = obj.getPatternInDataFrame()

memUSS = obj.getMemoryUSS()

print("Total Memory in USS:", memUSS)

memRSS = obj.getMemoryRSS()

print("Total Memory in RSS", memRSS)

run = obj.getRuntime()

print("Total ExecutionTime in seconds:", run)

Credits:

The complete program was written by P.Likhitha under the supervision of Professor Rage Uday Kiran.

getMemoryRSS() float[source]

Total amount of RSS memory consumed by the mining process will be retrieved from this function :return: returning RSS memory consumed by the mining process :rtype: float

getMemoryUSS() float[source]

Total amount of USS memory consumed by the mining process will be retrieved from this function :return: returning USS memory consumed by the mining process :rtype: float

getPatterns() dict[source]

Function to send the set of frequent patterns after completion of the mining process :return: returning frequent patterns :rtype: dict

getPatternsAsDataFrame() DataFrame[source]

Storing final frequent patterns in a dataframe :return: returning frequent patterns in a dataframe :rtype: pd.DataFrame

getRuntime() float[source]

Calculating the total amount of runtime taken by the mining process :return: returning total amount of runtime taken by the mining process :rtype: float

mine() None[source]

Association rule mining process will start from here

printResults() None[source]

Function to send the result after completion of the mining process

save(outFile) None[source]

Complete set of frequent patterns will be loaded in to an output file :param outFile: name of the outputfile :type outFile: file :return: None

startMine() None[source]

Association rule mining process will start from here

class PAMI.AssociationRules.basic.ARWithLift.Lift(patterns, singleItems, minConf)[source]

Bases: object

Parameters:
  • patterns (dict) – Dictionary containing patterns and its support value.

  • singleItems (list) – List containing all the single frequent items.

  • minConf (int) – Minimum confidence to mine all the satisfying association rules.

run() None[source]

To generate the combinations all association rules.

PAMI.AssociationRules.basic.RuleMiner module

class PAMI.AssociationRules.basic.RuleMiner.Confidence(patterns, singleItems, threshold)[source]

Bases: object

Association Rules are derived from frequent patterns using “confidence” metric.

run()[source]

To generate the combinations all association rules.

class PAMI.AssociationRules.basic.RuleMiner.Leverage(patterns, singleItems, threshold)[source]

Bases: object

Association Rules are derived from frequent patterns using “leverage” metric.

run()[source]

To generate the combinations all association rules.

class PAMI.AssociationRules.basic.RuleMiner.Lift(patterns, singleItems, threshold)[source]

Bases: object

Association Rules are derived from frequent patterns using “lift” metric.

run()[source]

To generate the combinations all association rules.

class PAMI.AssociationRules.basic.RuleMiner.RuleMiner(iFile, measure, threshold, sep)[source]

Bases: object

Description:

RuleMiner code is used to extract the association rules from given frequent patterns

Reference:

Parameters:
  • iFile – str : Name of the Input file to mine complete set of association rules

  • oFile – str : Name of the output file to store complete set of association rules

  • minConf – float : The user can specify the minConf in float between the range of 0 to 1.

  • frequentPattern – list or dict : frequent patterns are stored in the form of list or dictionary

  • measure – str : condition to calculate the strength of rule

  • threshold – int : condition to satisfy

  • sep – str : This variable is used to distinguish items from one another in a transaction. The default seperator is tab space. However, the users can override their default separator.

Attributes:
startTimefloat

To record the start time of the mining process

endTimefloat

To record the completion time of the mining process

finalPatternsdict

Storing the complete set of patterns in a dictionary variable

memoryUSSfloat

To store the total amount of USS memory consumed by the program

memoryRSSfloat

To store the total amount of RSS memory consumed by the program

Methods to execute code on terminal

Format:

(.venv) $ python3 RuleMiner.py <inputFile> <outputFile> <minConf> <sep>

Example Usage:

(.venv) $ python3 RuleMiner.py sampleDB.txt patterns.txt 0.5 ' '

Note

minConf will be considered only in 0 to 1.

Importing this algorithm into a python program

import PAMI.AssociationRules.basic import RuleMiner as alg

obj = alg.RuleMiner(iFile, measure, o.5, "  ")

obj.mine()

associationRules = obj.getPatterns()

print("Total number of Association Rules:", len(associationRules))

obj.save(oFile)

Df = obj.getPatternInDataFrame()

memUSS = obj.getMemoryUSS()

print("Total Memory in USS:", memUSS)

memRSS = obj.getMemoryRSS()

print("Total Memory in RSS", memRSS)

run = obj.getRuntime()

print("Total ExecutionTime in seconds:", run)
Methods:

mine()

getMemoryRSS()[source]

Total amount of RSS memory consumed by the mining process will be retrieved from this function :return: returning RSS memory consumed by the mining process :rtype: float

getMemoryUSS()[source]

Total amount of USS memory consumed by the mining process will be retrieved from this function :return: returning USS memory consumed by the mining process :rtype: float

getPatterns()[source]

Function to send the set of frequent patterns after completion of the mining process :return: returning frequent patterns :rtype: dict

getPatternsAsDataFrame()[source]

Storing final frequent patterns in a dataframe :return: returning frequent patterns in a dataframe :rtype: pd.DataFrame

getRuntime()[source]

Calculating the total amount of runtime taken by the mining process :return: returning total amount of runtime taken by the mining process :rtype: float

mine()[source]

Association rule mining process will start from here

printResults()[source]

Function to send the result after completion of the mining process

save(outFile)[source]

Complete set of frequent patterns will be loaded in to a output file :param outFile: name of the output file :type outFile: file

startMine()[source]

Association rule mining process will start from here

PAMI.AssociationRules.basic.abstract module

Module contents