Time Series Indexing: Implement iSAX in Python to index time series with confidence

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Build and use the most popular time series index available today with Python to search and join time series at the subsequence level Purchase of the print or Kindle book includes a free PDF eBook Key Features Learn how to implement algorithms and techniques from research papers Get to grips with building time series indexes using iSAX Leverage iSAX to solve real-world time series problems Book Description Time series are everywhere, ranging from financial data and system metrics to weather stations and medical records. Being able to access, search, and compare time series data quickly is essential, and this comprehensive guide enables you to do just that by helping you explore SAX representation and the most effective time series index, iSAX. The book begins by teaching you about the implementation of SAX representation in Python as well as the iSAX index, along with the required theory sourced from academic research papers. The chapters are filled with figures and plots to help you follow the presented topics and understand key concepts easily. But what makes this book really great is that it contains the right amount of knowledge about time series indexing using the right amount of theory and practice so that you can work with time series and develop time series indexes successfully. Additionally, the presented code can be easily ported to any other modern programming language, such as Swift, Java, C, C++, Ruby, Kotlin, Go, Rust, and JavaScript. By the end of this book, you'll have learned how to harness the power of iSAX and SAX representation to efficiently index and analyze time series data and will be equipped to develop your own time series indexes and effectively work with time series data. What you will learn Find out how to develop your own Python packages and write simple Python tests Understand what a time series index is and why it is useful Gain a theoretical and practical understanding of operating and creating time series indexes Discover how to use SAX representation and the iSAX index Find out how to search and compare time series Utilize iSAX visualizations to aid in the interpretation of complex or large time series Who this book is for This book is for practitioners, university students working with time series, researchers, and anyone looking to learn more about time series. Basic knowledge of UNIX, Linux, and Python and an understanding of basic programming concepts are needed to grasp the topics in this book. This book will also be handy for people who want to learn how to read research papers, learn from them, and implement their algorithms. Table of Contents An Introduction to Time Series and the Required Python Knowledge Implementing SAX iSAX – The Required Theory iSAX - The implementation Joining and Comparing iSAX Indexes Visualizing iSAX Indexes Using iSAX to Approximate MPdist Conclusions and Next Steps

Author(s): Mihalis Tsoukalos
Edition: 1
Publisher: Packt
Year: 2023

Language: English
Pages: 249

Cover
Title Page
Copyright
Dedication
Contributors
Table of Contents
Preface
Chapter 1: An Introduction to Time Series and the Required Python Knowledge
Technical requirements
Understanding time series
Time series are everywhere
Essential definitions
Time series data mining
Comparing time series
The Euclidean distance
The Chebyshev distance
What is an index and why do we need indexing?
The Python knowledge that we are going to need
Timing Python code
An introduction to Anaconda
The required Python packages
Setting up our environment
Printing package versions
Creating sample data
Publicly available time series data
How time series are processed
Reading time series from disk
Is all data numeric?
Do all lines have the same amount of data?
Creating subsequences
Visualizing time series
Working with the Matrix Profile
Exploring the MPdist distance
Summary
Resources and useful links
Exercises
Chapter 2: Implementing SAX
Technical requirements
The required theory
Why do we need SAX?
Normalization
Visualizing normalized time series
An introduction to SAX
The cardinality parameter
The segments parameter
How to manually find the SAX representation of a subsequence
Ηow can we divide 10 data points into 3 segments?
Reducing the cardinality of a SAX representation
Developing a Python package
The basics of Python packages
The SAX Python package
Working with the SAX package
Computing the SAX representations of the subsequences of a time series
Counting the SAX representations of a time series
The tsfresh Python package
Creating a histogram of a time series
Calculating the percentiles of a time series
Summary
Useful links
Exercises
Chapter 3: iSAX – The Required Theory
Technical requirements
Background information
Trees and binary trees
Understanding how iSAX works
The cardinality parameter
The segments parameter
The threshold parameter
Computing the normalized mean values
How big can an iSAX index get?
What happens when there is no space left for adding more subsequences to an iSAX index?
How iSAX is constructed
How iSAX is searched
Promotion strategy
Splitting nodes
Manually constructing an iSAX index
Updating the counting.py utility
Summary
Useful links
Exercises
Chapter 4: iSAX – The Implementation
Technical requirements
A quick look at the iSAX Python package
The class for storing subsequences
The class for iSAX nodes
The class for entire iSAX indexes
Explaining the missing parts
Exploring the remaining files
The tools.py file
The variables.py file
The sax.py file
Using the iSAX Python package
Reading the iSAX parameters
How to process subsequences to create an iSAX index
Creating our first iSAX index
Counting the subsequences of an iSAX index
How long does it take to create an iSAX index?
Dealing with iSAX overflows
Summary
Useful links
Exercises
Chapter 5: Joining and Comparing iSAX Indexes
Technical requirements
How the sliding window size affects the iSAX construction speed
Checking the search speed of iSAX indexes
Joining iSAX indexes
Implementing the joining of iSAX indexes
Explaining the Python code
Using the Python code
We have a long list of Euclidean distances, so what?
Saving the output
Finding iSAX nodes without a match
Writing Python tests
What are we going to test?
Comparing the number of subsequences
Checking the number of node splits
All Euclidean distances are 0
Running the tests
Summary
Useful links
Exercises
Chapter 6: Visualizing iSAX Indexes
Technical requirements
Storing an iSAX index in JSON format
Downloading the JavaScript code locally
Running the code locally
Visualizing an iSAX index
Visualizing iSAX as a tree
Trying something radical
More iSAX index visualizations
Using icicle plots
Visualizing iSAX as a Collapsible Tree
Summary
Useful links
Exercises
Chapter 7: Using iSAX to Approximate MPdist
Technical requirements
Understanding the Matrix Profile
What does the Matrix Profile compute?
Manually computing the exact Matrix Profile
Computing the Matrix Profile using iSAX
What happens if there is not a valid match?
Calculating the error
Approximate Matrix Profile implementation
Comparing the accuracy of two different parameter sets
Understanding MPdist
How to compute MPdist
Manually computing MPdist
Calculating MPdist using iSAX
Implementing the MPdist calculation in Python
Using the approximate Matrix Profile way
Using the join of two iSAX indexes
Using the Python code
Comparing the accuracy and the speed of the methods
Summary
Useful links
Exercises
Chapter 8: Conclusions and Next Steps
Concluding all that we have learned so far
Other variations of iSAX
Interesting research papers on time series
Interesting research papers on databases
Useful books
Useful books on databases
Building a strong computer science background
Books on UNIX and Linux
Books on the Python programming language
Summary
Useful links
Exercises
Index
About Packt
Other Books You May Enjoy