Registry / data / pyts
library0.13.0pypypi✓ verified 87d ago

pyts is a Python package dedicated to time series classification. It provides preprocessing and utility tools, along with implementations of various time series classification algorithms. The library maintains an active development status, with major versions often introducing new Python support and algorithms, currently at version 0.13.0.

pip install pyts
INSTALL
IMPORT
SIG · PYTS
P
pyts
datapythonv0.13.0
Install
13.1s avg
Import
4402ms
Disk
478MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.13.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
build_error
glibc
py 3.103.920 runs
installs and imports cleanly · install 13.1s · import 4.402s · 470MB
478MB installed
● package 478MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TimeSeriesForest
from pyts.classification import TimeSeriesForest
BagOfWords
from pyts.bag_of_words import BagOfWords
from pyts.bag_of_words import BagOfWords # for pre-v0.11.0 behavior
The BagOfWords algorithm was reworked in v0.11.0; its former version is now available as WordExtractor.
WordExtractor
from pyts.bag_of_words import WordExtractor
Introduced in v0.11.0, containing the functionality of the former BagOfWords.
load_gunpoint
from pyts.datasets import load_gunpoint
StandardScaler
from pyts.preprocessing import StandardScaler
BOSS
from pyts.transformation import BOSS

This quickstart loads the 'GunPoint' dataset, initializes a `TimeSeriesForest` classifier, trains it on the training data, and evaluates its accuracy on the test set. This demonstrates a common workflow for time series classification using `pyts`.

import numpy as np from pyts.datasets import load_gunpoint from pyts.classification import TimeSeriesForest # Load the GunPoint dataset X_train, X_test, y_train, y_test = load_gunpoint(return_X_y=True) # Initialize and train the Time Series Forest classifier clf = TimeSeriesForest(random_state=43) clf.fit(X_train, y_train) # Evaluate the classifier accuracy = clf.score(X_test, y_test) print(f"Accuracy of TimeSeriesForest: {accuracy:.4f}")
Debug
Known issues
breakingPython 3.7 support was dropped in v0.13.0. Python 3.6 support was dropped in v0.12.0, and Python 3.5 in v0.11.0. Ensure your Python environment meets the current requirements.
fix
Upgrade your Python interpreter to 3.8 or newer for pyts v0.11.0+, 3.9 or newer for pyts v0.12.0+, and 3.10 or newer for pyts v0.13.0+.
affects: >=0.11.0
breakingThe behavior of the `BagOfWords` algorithm was reworked in v0.11.0. If you relied on the old functionality, it has been moved to a new class, `WordExtractor`.
fix
For the old `BagOfWords` functionality, use `from pyts.bag_of_words import WordExtractor` instead. If you want the new `BagOfWords` behavior, update your code to reflect its new parameters or expected output.
affects: >=0.11.0
breaking`pyts` replaced `scikit-learn` mixin classes with its own internal mixin classes in v0.12.0. Custom estimators inheriting from deprecated `sklearn` mixins might encounter issues.
fix
Review custom `pyts`-compatible estimators that directly inherited from `scikit-learn` mixins. Update them to use `pyts`'s own mixin classes or ensure compatibility with `pyts`'s internal mixin implementations.
affects: >=0.12.0
gotchaMinimal versions of core dependencies (NumPy, SciPy, Scikit-Learn, Joblib, Numba) have been updated significantly in recent releases. Using an older `pyts` with newer dependencies, or a newer `pyts` with older dependencies, can lead to runtime errors or unexpected behavior.
fix
Always install `pyts` in a clean virtual environment and allow `pip` to resolve the latest compatible versions of its dependencies. Check the official `pyts` documentation for the exact dependency requirements for your `pyts` version. `pip install pyts` should handle this for the latest version.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pyts'
The `pyts` package has not been installed in the current Python environment.
fix
Run `pip install pyts` to install the library.
ImportError: cannot import name 'BagOfWords' from 'pyts.bag_of_words'
Attempting to import `BagOfWords` expecting its pre-v0.11.0 behavior, or from an incompatible version context.
fix
For the functionality of `BagOfWords` before v0.11.0, import `WordExtractor` instead: `from pyts.bag_of_words import WordExtractor`. If you intend to use the newer `BagOfWords` functionality, ensure your `pyts` version is 0.11.0 or newer.
AttributeError: type object 'MyCustomEstimator' has no attribute '_estimator_type'
This can occur when custom `pyts`-compatible estimators or pipelines rely on `scikit-learn`'s internal mixin classes which `pyts` replaced with its own in version 0.12.0. The `_estimator_type` attribute might be expected by `scikit-learn` utilities interacting with `pyts` components, but the internal implementation has changed.
fix
If this error occurs after updating `pyts` to v0.12.0 or newer, verify that any custom classes or integrations are compatible with `pyts`'s new internal mixin structure. It may require updating the custom estimator's inheritance or attributes to align with how `pyts` now defines estimator types internally, rather than directly relying on `sklearn`'s private APIs. Ensure that `pyts` estimators are used as intended within `scikit-learn` pipelines, which are generally supported.
Upgrade
Version history
0.13.0latest on PyPI · released Jun 18, 2023
Audit
Dependencies
NumPyrequiredNumerical operations and array handling.
SciPyrequiredScientific computing functionalities.
Scikit-LearnrequiredMachine learning base estimators and utilities; pyts API is heavily inspired by scikit-learn.
JoblibrequiredFor parallel processing and caching.
NumbarequiredFor high-performance numerical operations.
Agent activity
12 hits · last 30 days
node
10
Amazon
1
OpenAI (training)
1
Resources
pyts — pip install pyts · libregistry