HMiner

class PAMI.highUtilityPattern.basic.HMiner.HMiner(iFile1, minUtil, sep='\t')[source]

Bases: _utilityPatterns

Description:

High Utility itemSet Mining (HMIER) is an importent algorithm to miner High utility items from the database.

Reference:

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.

  • minSup – int or float or str : The user can specify minSup either in count or proportion of database size. If the program detects the data type of minSup is integer, then it treats minSup is expressed in count. Otherwise, it will be treated as float.

  • maxPer – float : The user can specify maxPer in count or proportion of database size. If the program detects the data type of maxPer is integer, then it treats maxPer is expressed in count.

  • 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

mapFMAP: list

EUCS map of the FHM algorithm

candidates: int

candidates genetated

huiCnt: int

huis created

neighbors: map

keep track of nighboues of elements

Methods:
mine()

Mining process will start from here

getPatterns()

Complete set of patterns will be retrieved with this function

save(oFile)

Complete set of frequent patterns will be loaded in to a 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

Explore_SearchTree(prefix, uList, minUtil)

A method to find all high utility itemSets

UpdateCLosed(x, culs, st, excul, newT, ex, ey_ts, length)

A method to update closed values

saveitemSet(prefix, prefixLen, item, utility)

A method to save itemSets

updateElement(z, culs, st, excul, newT, ex, duppos, ey_ts)

A method to updates vales for duplicates

construcCUL(x, culs, st, minUtil, length, exnighbors)

A method to construct CUL’s database

Executing the code on terminal:

Format:

(.venv) $ python3 HMiner.py <inputFile> <outputFile> <minUtil>

Example Usage:

(.venv) $ python3 HMiner.py sampleTDB.txt output.txt 35

Note

minSup will be considered in percentage of database transactions

Sample run of importing the code:

from PAMI.highUtilityPattern.basic import HMiner as alg

obj = alg.HMiner("input.txt",35)

obj.mine()

Patterns = obj.getPatterns()

print("Total number of high utility Patterns:", len(Patterns))

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 B.Sai Chitra 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]

Main program to start the operation

printResults()[source]

This function is used to print the results

save(outFile)[source]

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

startMine()[source]

Main program to start the operation