Time Series Indexing by Mihalis Tsoukalos

Time Series Indexing by Mihalis Tsoukalos

Author:Mihalis Tsoukalos
Language: eng
Format: epub
Publisher: Packt
Published: 2023-11-15T00:00:00+00:00


The variables.py file

This subsection presents the contents of the updated variables.py file, which contains variables that are accessible from anywhere in the code.

How much functionality is enough?

Keep in mind that sometimes we might need to include functionality that is going to help with debugging or might be needed in the future, and therefore, we might need to include variables or implement functions that are not going to be used right away or all the time. Just remember to keep a good balance between wanting to support everything and please everyone, which is impossible, and wanting to support the absolute minimum functionality, which usually lacks flexibility.

The contents of the variables.py file are the following:

# This file includes all variables for the isax package # maximumCardinality = 32 breakpointsFile = "SAXalphabet" # Breakpoints in breakpointsFile elements = "" slidingWindowSize = 16 segments = 0 # Maximum number of time series in a terminal node threshold = 100 # Keeps number of splits nSplits = 0 # Keep number of accesses of subsequences nSubsequences = 0 # Currently supporting TWO promotion strategies defaultPromotion = True # Number of overflows overflow = 0 # Floating point precision precision = 5 # Segment to promote promote = 0

The variables.promote variable defines the SAX word that is going to be promoted next if there is such a need. Put simply, we create the SAX representation of the two nodes of a split based on the value of variables.promote – we promote the segment defined by the value of variables.promote. Every time we have a split, variables.promote is updated according to the promotion (splitting) strategy and gets ready for the next split.

Should you wish to see the changes between two versions of the same file, you can use the diff(1) utility. In our case, the difference between the variables.py file found in the ch03 directory and the current version is the following:

2c2 < # This file includes all variables for the sax package --- > # This file includes all variables for the isax package 13a14,16 > # Breakpoints in breakpointsFile > elements = "" > 20,21c23,24 < # Breakpoints in breakpointsFile < elements = "" --- > # Maximum number of time series in a terminal node > threshold = 100 22a26,37 > # Keeps number of splits > nSplits = 0 > > # Keeps number of accesses of subsequences > nSubsequences = 0 > > # Currently supporting TWO promotion strategies > defaultPromotion = True > > # Number of overflows > overflow = 0 > 24a40,42 > > # Segment to promote > promote = 0

Lines beginning with > show the contents of ch04/isax/variables.py, whereas lines beginning with < show statements from ch03/sax/variables.py.

The next subsection discusses sax.py, which did not change that much.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.