timeseriescv
This package implements two cross-validation algorithms suitable to evaluate machine learning models based on time series datasets where each sample is tagged with a prediction time and an evaluation time.
Ressources
A Medium post providing some motivation and explaining the cross-validation algorithms implemented here in more detail.
Advances in financial machine learning by Marcos Lopez de Prado. An excellent book that inspired this package.
Installation
timeseriescv can be installed using pip:
>>> pip install timeseriescv
Content
For now the package contains two main classes handling cross-validation:
PurgedWalkForwardCV: Walk-forward cross-validation with purging.
CombPurgedKFoldCV: Combinatorial cross-validation with purging and embargoing.
Remarks concerning the API
The API is as similar to the scikit-learn API as possible. Like the scikit-learn cross-validation classes, the split method is a generator that yields a pair of numpy arrays containing the positional indices of the samples in the train and validation set, respectively. The main differences with the scikit-learn API are:
The split method takes as arguments not only the predictor values X, but also the prediction times pred_times and the evaluation times eval_times of each sample.
To stay as close to the scikit-learn API as possible, this data is passed as separate parameters. But in order to ensure that they are properly aligned, X, pred_times and eval_times are required to be pandas DataFrames/Series sharing the same index.
Check the docstrings of the cross-validation classes for more information.
Metadata
Release files for timeseriescv 0.2
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 |
|---|---|---|---|---|
| timeseriescv-0.2.tar.gz | 6.7 kB | Without provenance | Details for timeseriescv-0.2.tar.gz |
Release files / timeseriescv-0.2.tar.gz
| Download URL | timeseriescv-0.2.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6937e6b10eb5c7dcc0cf790f4c40b6abdcf925f1f67358f917d605a2f8c5cf5e
|
|
BLAKE2b-256 checksum How to use checksums |
a21337fe80a5f6ddac54899ad4ccc4aea1a838a1d7bc2b9342bd4a2a42ea0680
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.6
|
Security for timeseriescv 0.2
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.