traval
Tools for applying automatic error detection algorithms to time series.
Introduction
This module is set up to provide tools for applying any error detection algorithm to any time series. The module consists of three main components:
RuleSet: the RuleSet object is a highly flexible object for defining error detection algorithms based on (user-defined) functions.Detector: a data management object for storing time series and error detection results.SeriesComparison*: objects for comparing time series. These objects include plots for visualizing the comparisons.
The general workflow consists of the following steps:
- Define error detection algorithm(s).
- Load data, i.e. raw time series data and optionally time series representing the "truth" to see how well the algorithms perform.
- Initialize Detector objects and apply algorithms to time series.
- Store and analyze the results.
For more detailed information and examples, please refer to the notebooks in the examples directory.
Installation
To install the traval module, follow these steps:
- Clone the repository from GitHub.
- Open a terminal and navigate to the module root directory:
<your path here>/traval - Type
pip install -e .
Usage
The basic usage of the module is described below. To start using the module, import the package:
import traval
The first step is generally to define an error detection algorithm. This is
done with the RuleSet object:
ruleset = traval.RuleSet("my_first_algorithm")
Add a detection rule (using a general rule from the library contained within the module). In this case the rule states any value above 10.0 is suspect:
ruleset.add_rule(
"rule1",
traval.rulelib.rule_ufunc_threshold,
apply_to=0,
kwargs={"ufunc": (np.greater,), "threshold": 10.0}
)
Take a look at the ruleset by just typing ruleset:
ruleset
RuleSet: 'my_first_algorithm'
step: name apply_to
1: rule1 0
Next define a Detector object. This object is designed to store a time series
and the intermediate and final results after applying an error detection
algorithm. Initialize the Detector object with some time series. In this example
we assume there is a time series called raw_series:
>>> detect = traval.Detector(raw_series)
Apply our first algorithm to the time series.
>>> detect.apply_ruleset(ruleset)
By default, the result of each step in the algorithm is compared to the
original series and stored in the detect.comparisons attribute. Take a
look at the comparison between the raw data and the result of the error
detection algorithm.
Since we only defined one step, step 1 represents the final result.
>>> cp = detect.comparisons[1] # result of step 1 = final result
The SeriesComparison* objects contain methods to visualize the comparison,
or summarize the number of observations in each category:
>>> cp.plots.plot_series_comparison() # plot a comparison
>>> cp.summary # series containing number of observations in each category
For more detailed explanation and more complex examples, see the notebook(s) in the examples directory.
Author
- D.A. Brakenhoff, Artesia, 2020
Metadata
Release files for traval 0.5.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| traval-0.5.4.tar.gz | 42.6 kB | Without provenance | Details for traval-0.5.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| traval-0.5.4-py3-none-any.whl | Python 3 | none | any | Details for traval-0.5.4-py3-none-any.whl |
Total release size: 81.5 kB
Release files / traval-0.5.4.tar.gz
| Download URL | traval-0.5.4.tar.gz |
|---|---|
| Size | 42.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0588e299ecde55b206f4e2aac10f3a1d33862fc3acc7ef4d73778a2fda8ff802
|
|
BLAKE2b-256 checksum How to use checksums |
5c97923ccd97d78f0392185b68778fde241de452c9becb07f936d6e881bec23d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / traval-0.5.4-py3-none-any.whl
| Download URL | traval-0.5.4-py3-none-any.whl |
|---|---|
| Size | 38.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
18fb1ab562fb4ee234c567c2139038ba831b71dcdf1619ad783def589433c171
|
|
BLAKE2b-256 checksum How to use checksums |
4da20bed1462e7811ba64e189607adc97cf9ce11f2042aac5bd23df001633386
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for traval 0.5.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.