UPGrowth
- class PAMI.highUtilityPattern.basic.UPGrowth.UPGrowth(iFile: str, minUtil: int, sep: str = '\t')[source]
Bases:
_utilityPatterns
- Description:
UP-Growth is two-phase algorithm to mine High Utility Itemsets from transactional databases.
- Reference:
Vincent S. Tseng, Cheng-Wei Wu, Bai-En Shie, and Philip S. Yu. 2010. UP-Growth: an efficient algorithm for high utility itemset mining. In Proceedings of the 16th ACM SIGKDD international conference on Knowledge discovery and data mining (KDD ‘10). Association for Computing Machinery, New York, NY, USA, 253–262. DOI:https://doi.org/10.1145/1835804.1835839
- Parameters:
iFile – str : Name of the Input file to mine complete set of High Utility patterns
oFile – str : Name of the output file to store complete set of High Utility patterns
minUtil – int : The user given minUtil value.
candidateCount – int Number of candidates specified by user
maxMemory – int Maximum memory used by this program for running
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:
- iFilefile
Name of the input file to mine complete set of frequent patterns
- oFilefile
Name of the output file to store complete set of frequent patterns
- memoryRSSfloat
To store the total amount of RSS memory consumed by the program
- startTime:float
To record the start time of the mining process
- endTime:float
To record the completion time of the mining process
- minUtilint
The user given minUtil
- NumberOfNodesint
Total number of nodes generated while building the tree
- ParentNumberOfNodesint
Total number of nodes required to build the parent tree
- MapItemToMinimumUtilitymap
A map to store the minimum utility of item in the database
- phuislist
A list to store the phuis
- MapItemToTwumap
A map to store the twu of each item in database
- Methods:
- mine()
Mining process will start from here
- getPatterns()
Complete set of patterns will be retrieved with this function
- createLocalTree(tree, item)
A Method to Construct conditional pattern base
- UPGrowth( tree, alpha)
A Method to Mine UP Tree recursively
- PrintStats()
A Method to print number of phuis
- save(oFile)
Complete set of frequent patterns will be loaded in to an output file
- getPatternsAsDataFrame()
Complete set of frequent patterns will be loaded in to a dataframe
- getMemoryUSS()
Total amount of USS memory consumed by the mining process will be retrieved from this function
- getMemoryRSS()
Total amount of RSS memory consumed by the mining process will be retrieved from this function
- getRuntime()
Total amount of runtime taken by the mining process will be retrieved from this function
Executing the code on terminal:
Format: (.venv) $ python3 UPGrowth <inputFile> <outputFile> <Neighbours> <minUtil> <sep> Example Usage: (.venv) $ python3 UPGrowth sampleTDB.txt output.txt sampleN.txt 35
Note
maxMemory will be considered as Maximum memory used by this program for running
Sample run of importing the code:
from PAMI.highUtilityPattern.basic import UPGrowth as alg obj=alg.UPGrowth("input.txt",35) obj.mine() highUtilityPattern = obj.getPatterns() print("Total number of Spatial Frequent Patterns:", len(highUtilityPattern)) obj.save("output") 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 Pradeep pallikila 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