Getting Started with Aeon: Your Open-Source Time Series Toolkit

Jan 12, 2022 | Data Science

Welcome to Aeon! Aeon is an open-source toolkit for learning from time series. It’s compatible with scikit-learn and provides access to cutting-edge algorithms for time series machine learning. This toolkit simplifies complex tasks such as forecasting and classification, streamlining the learning process for any data enthusiast!

What Can Aeon Do?

Aeon aims to offer a broad library of time series algorithms, focusing not only on the newest advancements but also on classical techniques. You can efficiently implement these algorithms using numba, and benefit from seamless integration with other time series packages. The latest release is v0.11.1 which you can view in the full changelog.

Installation

To get started with Aeon, first ensure that your Python version is 3.9 or greater. The easiest way to install Aeon is via pip:

pip install aeon

If you want to install the full package with all optional dependencies, use:

pip install aeon[all_extras]

For installation instructions from the GitHub source, visit here.

Getting Started

The best way to dive into Aeon packages is through the getting started guide. Below, we present a quick example for classification and clustering.

Example: Classification

Imagine that you are a librarian who needs to categorize various books based on themes. Using Aeon is like training your classification model to recognize these themes based on past data. Here’s how to do it:

import numpy as np
from aeon.classification.distance_based import KNeighborsTimeSeriesClassifier

# Example data: each book’s storyline broken into thematic elements
X = [[[1, 2, 3, 4, 5, 5]],  # 3D array example (univariate)
     [[1, 2, 3, 4, 4, 2]],
     [[8, 7, 6, 5, 4, 4]]]
y = [low, low, high]  # Labels for each storyline

X = np.array(X)
y = np.array(y)

# Create and fit classifier
clf = KNeighborsTimeSeriesClassifier(distance='dtw')
clf.fit(X, y)

# Predictions
X_test = np.array([[[2, 2, 2, 2, 2, 2]], [[5, 5, 5, 5, 5, 5]], [[6, 6, 6, 6, 6, 6]]])
y_pred = clf.predict(X_test)  # Get class predictions
print(y_pred)  # Output might look like: [low high high]

Example: Clustering

Now, think of clustering as grouping your books into different shelves based on similar themes. Here’s how to accomplish that:

import numpy as np
from aeon.clustering import TimeSeriesKMeans

X = np.array([[[1, 2, 3, 4, 5, 5]],  # 3D array example (univariate)
               [[1, 2, 3, 4, 4, 2]],
               [[8, 7, 6, 5, 4, 4]]])
clu = TimeSeriesKMeans(distance='dtw', n_clusters=2)
clu.fit(X)  # Fit clusterer on training data

# Get training cluster labels
print(clu.labels_)  # Output: array([0, 0, 1])

# Predictions for new data
X_test = np.array([[[2, 2, 2, 2, 2, 2]], [[5, 5, 5, 5, 5, 5]], [[6, 6, 6, 6, 6, 6]]])
print(clu.predict(X_test))  # Assign clusters to new data

Troubleshooting

If you run into issues, here are some troubleshooting ideas:

  • Check your Python version—ensure it’s 3.9 or greater.
  • Ensure you have all necessary packages installed, particularly if you opted for specific dependencies.
  • Consult the GitHub Issue Tracker for any similar problems.
  • Join our Slack community for real-time support.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

With Aeon, the powerful world of time series analysis is at your fingertips. Happy coding!

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox