Metric
TimeSeriesAUPRC
TimeSeriesAUPRC: TimeSeries area under precision recall curve.
Quickstart
python
from sktime.performance_metrics.detection import TimeSeriesAUPRC
estimator = TimeSeriesAUPRC(integration='trapezoid', weighted_precision=True, with_scores=False)Parameters(3)
- integrationstr, optional (default=trapezoid)
- This parameter specifies the method used to compute the Area Under the Precision-Recall Curve (AUPRC).
- weighted_precision: bool, optional (default=True)
- parameter determines whether the precision should be computed in a weighted fashion.
- with_scoresbool, optional (default= False)
- This parameter determines whether the input is in label-score format. If False, then assumes input format to be Predicted and Actual Events.
Examples
>>> import numpy as np
>>> from sktime.performance_metrics.detection import TimeSeriesAUPRC
>>> ts_auprc = TimeSeriesAUPRC (with_scores = True)
>>> y_true = np. array ([0, 0, 1, 1, 0, 0, 1 ])
>>> y_pred = np. array ([0.1, 0.3, 0.7, 0.8, 0.2, 0.0, 0.9 ])
>>> area = ts_auprc. evaluate (y_true, y_pred)References
- [1 ] Tatbul,T.J. Lee,S. Zdonik,M. Alam,J. Gottschlich. Precision and recall for time series. Advances in neural information processing systems... [Rf9676c9c8196-2] D. Wagner,T. Michels,F.C.F. Schulz,A. Nair,M. Rudolph and M. Kloft. TimeSeAD: Benchmarking Deep Multivariate Time-Series Anomaly Detection. Transactions on Machine Learning Research (TMLR), (to appear) 2023.