All Projects → CompML → PRTS

CompML / PRTS

Licence: Apache-2.0 license
Unofficial Python implementation of "Precision and Recall for Time Series".

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to PRTS

Pyodds
An End-to-end Outlier Detection System
Stars: ✭ 141 (+291.67%)
Mutual labels:  time-series-analysis
neuralRDEs
Code for: "Neural Rough Differential Equations for Long Time Series", (ICML 2021)
Stars: ✭ 102 (+183.33%)
Mutual labels:  time-series-analysis
CoronaDash
COVID-19 spread shiny dashboard with a forecasting model, countries' trajectories graphs, and cluster analysis tools
Stars: ✭ 20 (-44.44%)
Mutual labels:  time-series-analysis
Stumpy
STUMPY is a powerful and scalable Python library for modern time series analysis
Stars: ✭ 2,019 (+5508.33%)
Mutual labels:  time-series-analysis
Lotteryprediction
🌝 Lottery prediction besides of following "law of proability","Probability: Independent Events", there are still "Saying "a Tail is due", or "just one more go, my luck is due to change" is called The Gambler's Fallacy" existed.
Stars: ✭ 202 (+461.11%)
Mutual labels:  time-series-analysis
NAGPythonExamples
Examples and demos showing how to call functions from the NAG Library for Python
Stars: ✭ 46 (+27.78%)
Mutual labels:  time-series-analysis
Deeptime
Python library for analysis of time series data including dimensionality reduction, clustering, and Markov model estimation
Stars: ✭ 138 (+283.33%)
Mutual labels:  time-series-analysis
Deep XF
Package towards building Explainable Forecasting and Nowcasting Models with State-of-the-art Deep Neural Networks and Dynamic Factor Model on Time Series data sets with single line of code. Also, provides utilify facility for time-series signal similarities matching, and removing noise from timeseries signals.
Stars: ✭ 83 (+130.56%)
Mutual labels:  time-series-analysis
Banpei
Anomaly detection library based on singular spectrum transformation(sst)
Stars: ✭ 231 (+541.67%)
Mutual labels:  time-series-analysis
timemachines
Predict time-series with one line of code.
Stars: ✭ 342 (+850%)
Mutual labels:  time-series-analysis
Pyfts
An open source library for Fuzzy Time Series in Python
Stars: ✭ 154 (+327.78%)
Mutual labels:  time-series-analysis
Bamboobsc
bambooBSC is an opensource Balanced Scorecard (BSC) Business Intelligence (BI) Web platform. BSC's Vision, Perspectives, Objectives of strategy, Key Performance Indicators (KPIs), Strategy Map, and SWOT, PDCA & PDCA report, Time Series Analysis.
Stars: ✭ 197 (+447.22%)
Mutual labels:  time-series-analysis
Time-Series-Analysis-and-Forecasting-with-Python
No description or website provided.
Stars: ✭ 24 (-33.33%)
Mutual labels:  time-series-analysis
Matrixprofile
A Python 3 library making time series data mining tasks, utilizing matrix profile algorithms, accessible to everyone.
Stars: ✭ 141 (+291.67%)
Mutual labels:  time-series-analysis
traja
Python tools for spatial trajectory and time-series data analysis
Stars: ✭ 65 (+80.56%)
Mutual labels:  time-series-analysis
Practical Machine Learning With Python
Master the essential skills needed to recognize and solve complex real-world problems with Machine Learning and Deep Learning by leveraging the highly popular Python Machine Learning Eco-system.
Stars: ✭ 1,868 (+5088.89%)
Mutual labels:  time-series-analysis
tsa4
R code for Time Series Analysis and Its Applications, Ed 4
Stars: ✭ 108 (+200%)
Mutual labels:  time-series-analysis
Time-Series-Forecasting
Rainfall analysis of Maharashtra - Season/Month wise forecasting. Different methods have been used. The main goal of this project is to increase the performance of forecasted results during rainy seasons.
Stars: ✭ 27 (-25%)
Mutual labels:  time-series-analysis
ARIMA
Simple python example on how to use ARIMA models to analyze and predict time series.
Stars: ✭ 169 (+369.44%)
Mutual labels:  time-series-analysis
pssa
Singular Spectrum Analysis for time series forecasting in Python
Stars: ✭ 119 (+230.56%)
Mutual labels:  time-series-analysis

Precision and Recall for Time Series

GitHub stars License Python package PyPI version

Unofficial python implementation of Precision and Recall for Time Series.

Classical anomaly detection is principally concerned with point-based anomalies, those anomalies that occur at a single point in time. Yet, many real-world anomalies are range-based, meaning they occur over a period of time. Motivated by this observation, we present a new mathematical model to evaluate the accuracy of time series classification algorithms. Our model expands the well-known Precision and Recall metrics to measure ranges, while simultaneously enabling customization support for domain-specific preferences.

This is the open source software released by Computational Mathematics Laboratory. It is available for download on PyPI.

Installation

PyPI

PRTS is on PyPI, so you can use pip to install it.

$ pip install prts

from github

You can also use the following command to install.

$ git clone https://github.com/CompML/PRTS.git
$ cd PRTS
$ make install  # (or make develop)

Usage

from prts import ts_precision, ts_recall


# calculate time series precision score
precision_flat = ts_precision(real, pred, alpha=0.0, cardinality="reciprocal", bias="flat")
precision_front = ts_precision(real, pred, alpha=0.0, cardinality="reciprocal", bias="front")
precision_middle = ts_precision(real, pred, alpha=0.0, cardinality="reciprocal", bias="middle")
precision_back = ts_precision(real, pred, alpha=0.0, cardinality="reciprocal", bias="back")
print("precision_flat=", precision_flat)
print("precision_front=", precision_front)
print("precision_middle=", precision_middle)
print("precision_back=", precision_back)

# calculate time series recall score
recall_flat = ts_recall(real, pred, alpha=0.0, cardinality="reciprocal", bias="flat")
recall_front = ts_recall(real, pred, alpha=0.0, cardinality="reciprocal", bias="front")
recall_middle = ts_recall(real, pred, alpha=0.0, cardinality="reciprocal", bias="middle")
recall_back = ts_recall(real, pred, alpha=0.0, cardinality="reciprocal", bias="back")
print("recall_flat=", recall_flat)
print("recall_front=", recall_front)
print("recall_middle=", recall_middle)
print("recall_back=", recall_back)

Parameters

Parameter Description Type
alpha Relative importance of existence reward (0 ≤ alpha ≤ 1). float
cardinality Cardinality type. This should be "one", "reciprocal" or "udf_gamma" string
bias Positional bias. This should be "flat", "front", "middle", or "back" string

Examples

We provide a simple example code. By the following command you can run the example code for the toy dataset and visualize the metrics.

$ python3 examples/precision_recall_for_time_series.py

example output

Tests

You can run all the test codes as follows:

$ make test

References

  • Tatbul, Nesime, Tae Jun Lee, Stan Zdonik, Mejbah Alam, and Justin Gottschlich. 2018. “Precision and Recall for Time Series.” In Advances in Neural Information Processing Systems, edited by S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, 31:1920–30. Curran Associates, Inc.

LICENSE

This repository is Apache-style licensed, as found in the LICENSE file.

Citation

@software{https://doi.org/10.5281/zenodo.4428056,
  doi = {10.5281/ZENODO.4428056},
  url = {https://zenodo.org/record/4428056},
  author = {Ryohei Izawa, Ryosuke Sato, Masanari Kimura},
  title = {PRTS: Python Library for Time Series Metrics},
  publisher = {Zenodo},
  year = {2021},
  copyright = {Open Access}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].