Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2 updated docs #392

Merged
merged 6 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
/pami.egg-info
/build
/dist
/sphinxDoc
/finalSphinxDocs
/sphinxDoc
8 changes: 5 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ build:

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: sphinx/conf.py
fail_on_warning: false #true if you want to stop the building process
configuration: finalSphinxDocs/conf.py
fail_on_warning: false

#true if you want to stop the building process

# Optionally build your docs in additional formats such as PDF and ePub
formats:
Expand All @@ -35,4 +37,4 @@ formats:
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: binder/requirements.txt
- requirements: binder/requirements.txt
272 changes: 135 additions & 137 deletions PAMI/fuzzyGeoreferencedFrequentPattern/basic/FFSPMiner_old.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,151 +176,149 @@ def __init__(self):


class FFSPMiner(_ab._fuzzySpatialFrequentPatterns):
"""
About this algorithm
====================

:Description: Fuzzy Frequent Spatial Pattern-Miner is desired to find all Spatially frequent fuzzy patterns
which is on-trivial and challenging problem to its huge search space.we are using efficient pruning
techniques to reduce the search space.

Reference: Reference: P. Veena, B. S. Chithra, R. U. Kiran, S. Agarwal and K. Zettsu, "Discovering Fuzzy Frequent
Spatial Patterns in Large Quantitative Spatiotemporal databases," 2021 IEEE International Conference on Fuzzy Systems
(FUZZ-IEEE), 2021, pp. 1-8, doi: 10.1109/FUZZ45933.2021.9494594.

:param iFile: str :
Name of the Input file to mine complete set of frequent patterns
:param oFile: str :
Name of the output file to store complete set of frequent patterns
:param 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.
:param 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.
:param nFile: str :
Name of the input file to mine complete set of frequent patterns
:param 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:

iFile : file
Name of the input file to mine complete set of fuzzy spatial frequent patterns
oFile : file
Name of the oFile file to store complete set of fuzzy spatial frequent patterns
minSup : float
The user given minimum support
neighbors : map
keep track of neighbours of elements
memoryRSS : float
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
itemsCnt : int
To record the number of fuzzy spatial itemSets generated
mapItemsLowSum : map
To keep track of low region values of items
mapItemsMidSum : map
To keep track of middle region values of items
mapItemsHighSum : map
To keep track of high region values of items
mapItemSum : map
To keep track of sum of Fuzzy Values of items
mapItemRegions : map
To Keep track of fuzzy regions of item
joinsCnt : int
To keep track of the number of FFI-list that was constructed
BufferSize : int
represent the size of Buffer
itemSetBuffer : list
to keep track of items in buffer

: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
convert(value)
To convert the given user specified value
FSFIMining( prefix, prefixLen, fsFim, minSup)
Method generate FFI from prefix
construct(px, py)
A function to construct Fuzzy itemSet from 2 fuzzy itemSets
Intersection(neighbourX,neighbourY)
Return common neighbours of 2 itemSet Neighbours
findElementWithTID(uList, tid)
To find element with same tid as given
WriteOut(prefix, prefixLen, item, sumIUtil,period)
To Store the patten

Execution methods
=================


**Terminal command**
.. code-block:: console

Format:

(.venv) $ python3 FFSPMiner_old.py <inputFile> <outputFile> <neighbours> <minSup> <sep>

Example Usage:

(.venv) $ python3 FFSPMiner_old.py sampleTDB.txt output.txt sampleN.txt 3

(.venv) $ python3 FFSPMiner_old.py sampleTDB.txt output.txt sampleN.txt 0.3

(.venv) $ python3 FFSPMiner_old.py sampleTDB.txt output.txt sampleN.txt 3

.. note:: minSup will be considered in percentage of database transactions


**Sample run of importing the code:**
----------------------------------------

from PAMI.fuzzyGeoreferencedFrequentPattern import FFSPMiner as alg

obj = alg.FFSPMiner("input.txt", "neighbours.txt", 2)

obj.mine()

fuzzySpatialFrequentPatterns = obj.getPatterns()

print("Total number of fuzzy frequent spatial patterns:", len(fuzzySpatialFrequentPatterns))

obj.save("outputFile")
"""
About this algorithm
====================

:Description: Fuzzy Frequent Spatial Pattern-Miner is desired to find all Spatially frequent fuzzy patterns
which is on-trivial and challenging problem to its huge search space.we are using efficient pruning
techniques to reduce the search space.

Reference: Reference: P. Veena, B. S. Chithra, R. U. Kiran, S. Agarwal and K. Zettsu, "Discovering Fuzzy Frequent
Spatial Patterns in Large Quantitative Spatiotemporal databases," 2021 IEEE International Conference on Fuzzy Systems
(FUZZ-IEEE), 2021, pp. 1-8, doi: 10.1109/FUZZ45933.2021.9494594.

:param iFile: str :
Name of the Input file to mine complete set of frequent patterns
:param oFile: str :
Name of the output file to store complete set of frequent patterns
:param 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.
:param 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.
:param nFile: str :
Name of the input file to mine complete set of frequent patterns
:param 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:

iFile : file
Name of the input file to mine complete set of fuzzy spatial frequent patterns
oFile : file
Name of the oFile file to store complete set of fuzzy spatial frequent patterns
minSup : float
The user given minimum support
neighbors : map
keep track of neighbours of elements
memoryRSS : float
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
itemsCnt : int
To record the number of fuzzy spatial itemSets generated
mapItemsLowSum : map
To keep track of low region values of items
mapItemsMidSum : map
To keep track of middle region values of items
mapItemsHighSum : map
To keep track of high region values of items
mapItemSum : map
To keep track of sum of Fuzzy Values of items
mapItemRegions : map
To Keep track of fuzzy regions of item
joinsCnt : int
To keep track of the number of FFI-list that was constructed
BufferSize : int
represent the size of Buffer
itemSetBuffer : list
to keep track of items in buffer

: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
convert(value)
To convert the given user specified value
FSFIMining( prefix, prefixLen, fsFim, minSup)
Method generate FFI from prefix
construct(px, py)
A function to construct Fuzzy itemSet from 2 fuzzy itemSets
Intersection(neighbourX,neighbourY)
Return common neighbours of 2 itemSet Neighbours
findElementWithTID(uList, tid)
To find element with same tid as given
WriteOut(prefix, prefixLen, item, sumIUtil,period)
To Store the patten

Execution methods
=================


**Terminal command**
.. code-block:: console

Format:

(.venv) $ python3 FFSPMiner_old.py <inputFile> <outputFile> <neighbours> <minSup> <sep>

Example Usage:

(.venv) $ python3 FFSPMiner_old.py sampleTDB.txt output.txt sampleN.txt 3

(.venv) $ python3 FFSPMiner_old.py sampleTDB.txt output.txt sampleN.txt 0.3

(.venv) $ python3 FFSPMiner_old.py sampleTDB.txt output.txt sampleN.txt 3

.. note:: minSup will be considered in percentage of database transactions


**Sample run of importing the code:**
----------------------------------------

from PAMI.fuzzyGeoreferencedFrequentPattern import FFSPMiner as alg

obj = alg.FFSPMiner("input.txt", "neighbours.txt", 2)

obj.mine()

memUSS = obj.getMemoryUSS()
fuzzySpatialFrequentPatterns = obj.getPatterns()

print("Total Memory in USS:", memUSS)
print("Total number of fuzzy frequent spatial patterns:", len(fuzzySpatialFrequentPatterns))

memRSS = obj.getMemoryRSS()
obj.save("outputFile")

memUSS = obj.getMemoryUSS()

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

memRSS = obj.getMemoryRSS()

print("Total Memory in RSS", memRSS)
print("Total Memory in RSS", memRSS)

run = obj.getRuntime()
run = obj.getRuntime()

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

Credits
=======
The complete program was written by B.Sai Chitra under the supervision of Professor Rage Uday Kiran.
Credits
=======
The complete program was written by B.Sai Chitra under the supervision of Professor Rage Uday Kiran.
"""


_minSup = str()
_iFile = " "
_nFile = " "
Expand Down
9 changes: 2 additions & 7 deletions PAMI/partialPeriodicFrequentPattern/basic/GPFgrowth.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,11 +663,6 @@ def __readDatabase(self):
print("File Not Found")
quit()

@deprecated("It is recommended to use mine() instead of startMine() for mining process")
def startMine(self):

self.mine()

def mine(self):
self.__inputFile = self._partialPeriodicPatterns__iFile
self._partialPeriodicPatterns__startTime = time.time()
Expand Down Expand Up @@ -773,7 +768,7 @@ def printResults(self):
ap = GPFgrowth(sys.argv[1], sys.argv[3], sys.argv[4], sys.argv[5], sys.argv[6])
if len(sys.argv) == 6:
ap = GPFgrowth(sys.argv[1], sys.argv[3], sys.argv[4], sys.argv[5])
ap.startMine()
ap.mine()
print("Total number of Frequent Patterns:", len(ap.getPatterns()))
ap.save(sys.argv[2])
print("Total Memory in USS:", ap.getMemoryUSS())
Expand All @@ -782,7 +777,7 @@ def printResults(self):
else:
for i in [1000, 2000, 3000, 4000, 5000]:
_ap = GPFgrowth('/Users/Likhitha/Downloads/temporal_T10I4D100K.csv', i, 500, 0.7, '\t')
_ap.startMine()
_ap.mine()
print("Total number of Maximal Partial Periodic Patterns:", len(_ap.getPatterns()))
_ap.save('/Users/Likhitha/Downloads/output.txt')
print("Total Memory in USS:", _ap.getMemoryUSS())
Expand Down
12 changes: 2 additions & 10 deletions PAMI/partialPeriodicFrequentPattern/basic/PPF_DFS.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,14 +421,6 @@ def __Generation(self, prefix, itemsets, tidsets):
self.__save(prefix, list(set(itemsetx)), tidsetx)


@deprecated("It is recommended to use mine() instead of startMine() for mining process")
def startMine(self):
"""
Main program start with extracting the periodic frequent items from the database and
performs prefix equivalence to form the combinations and generates closed periodic frequent patterns.
"""
self.mine()

def mine(self):
"""
Main program start with extracting the periodic frequent items from the database and
Expand Down Expand Up @@ -549,7 +541,7 @@ def printResults(self):
ap = PPF_DFS(sys.argv[1], sys.argv[3], sys.argv[4], sys.argv[5], sys.argv[6])
if len(sys.argv) == 6:
ap = PPF_DFS(sys.argv[1], sys.argv[3], sys.argv[4], sys.argv[5])
ap.startMine()
ap.mine()
print("Total number of Frequent Patterns:", len(ap.getPatterns()))
ap.save(sys.argv[2])
print("Total Memory in USS:", ap.getMemoryUSS())
Expand All @@ -558,7 +550,7 @@ def printResults(self):
else:
for i in [1000, 2000, 3000, 4000, 5000]:
_ap = PPF_DFS('/Users/Likhitha/Downloads/temporal_T10I4D100K.csv', i, 500, 0.7, '\t')
_ap.startMine()
_ap.mine()
print("Total number of Maximal Partial Periodic Patterns:", len(_ap.getPatterns()))
_ap.save('/Users/Likhitha/Downloads/output.txt')
print("Total Memory in USS:", _ap.getMemoryUSS())
Expand Down
Loading