{ "info": { "author": "Wenjie Zheng", "author_email": "work@zhengwenjie.net", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Topic :: Scientific/Engineering", "Topic :: Software Development" ], "description": "![](train-gap-test.svg)\n\n# TSCV: Time Series Cross-Validation\n\nThis repository is a [scikit-learn](https://scikit-learn.org) extension for time series cross-validation.\nIt introduces **gaps** between the training set and the test set, which mitigates the temporal dependence of time series and prevents information leak.\n\n## Installation\n\n```bash\npip install tscv\n```\n\n## Update\n\n```bash\npip install tscv --upgrade\n```\n\nI recommend you to update it often.\n\n## Usage\n\nThis extension defines 3 cross-validator classes and 1 function:\n- `GapLeavePOut`\n- `GapKFold`\n- `GapWalkForward`\n- `gap_train_test_split`\n\nThe three classes can all be passed, as the `cv` argument, to the `cross_val_score` function in `scikit-learn`, just like the native cross-validator classes in `scikit-learn`.\n\nThe one function is an alternative to the `train_test_split` function in `scikit-learn`.\n\n## Examples\n\nThe following example uses `GapKFold` instead of `KFold` as the cross-validator.\n```python\nimport numpy as np\nfrom sklearn import datasets\nfrom sklearn import svm\nfrom sklearn.model_selection import cross_val_score\nfrom tscv import GapKFold\n\niris = datasets.load_iris()\nclf = svm.SVC(kernel='linear', C=1)\n\n# use GapKFold as the cross-validator\ncv = GapKFold(n_splits=5, gap_before=5, gap_after=5)\nscores = cross_val_score(clf, iris.data, iris.target, cv=cv)\n```\n\nThe following example uses `gap_train_test_split` to split the data set into the training set and the test set.\n```python\nimport numpy as np\nfrom tscv import gap_train_test_split\n\nX, y = np.arange(20).reshape((10, 2)), np.arange(10)\nX_train, X_test, y_train, y_test = gap_train_test_split(X, y, test_size=2, gap_size=2)\n```\n\n## Support\nSee the documentation [here](http://www.zhengwenjie.net/tscv/).\n\nIf you need any further help, please use the issue tracker.\n\n## Contributing\n- Report bugs in the issue tracker\n- Express your use cases in the issue tracker\n\n## Authors\nThis extension is mainly developed by me, Wenjie Zheng.\n\nThe `GapWalkForward` cross-validator is adapted from the `TimeSeriesSplit` of `scikit-learn`.\n\n## Acknowledgment\n- I would like to thank Christoph Bergmeir, Prabir Burman, and Jeffrey Racine for the helpful discussion.\n- I would like to thank Jacques Joubert for encouraging me to develop this package.\n\n## License\nBSD-3-Clause\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/WenjieZ/TSCV", "keywords": "", "license": "new BSD", "maintainer": "", "maintainer_email": "", "name": "tscv", "package_url": "https://pypi.org/project/tscv/", "platform": "", "project_url": "https://pypi.org/project/tscv/", "project_urls": { "Homepage": "https://github.com/WenjieZ/TSCV" }, "release_url": "https://pypi.org/project/tscv/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "Time series cross-validation", "version": "0.0.3" }, "last_serial": 5287879, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "6fa3084e5fdf2847238c8769ce835255", "sha256": "703f1f414f49364b037185aea23531a296e4054e52b85b45766da3c371d44caa" }, "downloads": -1, "filename": "tscv-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6fa3084e5fdf2847238c8769ce835255", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 8911, "upload_time": "2019-05-14T22:24:13", "url": "https://files.pythonhosted.org/packages/b5/25/c417d12946c27aa2d42dd6db823495831a02c26282111eea13966456ed21/tscv-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6747447d67f0a5d5cd227b40aa9d0455", "sha256": "4a156e4337c3bcd445529992231ddb77798e6d51d6beb74cd28ed9b6814805d0" }, "downloads": -1, "filename": "tscv-0.0.1.tar.gz", "has_sig": false, "md5_digest": "6747447d67f0a5d5cd227b40aa9d0455", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7522, "upload_time": "2019-05-14T22:24:15", "url": "https://files.pythonhosted.org/packages/3d/70/77c6442775640997e192256c82a0251186be549145d0999df0af6381a364/tscv-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "c80d72c788affcd0385bd9027696aa37", "sha256": "ed9edeed34deb4ae9852dff3ab39b7a196512434f7704f84c7a238783927aa7c" }, "downloads": -1, "filename": "tscv-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "c80d72c788affcd0385bd9027696aa37", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 8776, "upload_time": "2019-05-15T13:26:05", "url": "https://files.pythonhosted.org/packages/33/17/4ddd2bd361bbade4d4de460775747db089dc18dc153d616a6e3341d3b2af/tscv-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "83605ef23356e50843cde19158e4cc9c", "sha256": "2855d85cda1f988cfa3c7466241211ea0e7351c4228fad650b7757091eb4815c" }, "downloads": -1, "filename": "tscv-0.0.2.tar.gz", "has_sig": false, "md5_digest": "83605ef23356e50843cde19158e4cc9c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7398, "upload_time": "2019-05-15T13:26:07", "url": "https://files.pythonhosted.org/packages/7a/16/a171fd76f12bfc99fe559763b7d460ae70279703aa2e44d19d07fd449714/tscv-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "b0880a04cbf84fffdb6c314ba3f050e7", "sha256": "d21d975829893e25b488261c4666ec0354e8b0547dfe6429786901b6f28602b0" }, "downloads": -1, "filename": "tscv-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "b0880a04cbf84fffdb6c314ba3f050e7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8816, "upload_time": "2019-05-19T09:47:38", "url": "https://files.pythonhosted.org/packages/14/04/fe3e2eb3a76b63ef89f8788a70627f9a659a6c7b84f1ef504dba869ef8a7/tscv-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3a08eff11bb6a67efc371a5488b7f4c9", "sha256": "e4913737333f269b7429f30923d75280124e91c1af77b447841b79d8bcb37758" }, "downloads": -1, "filename": "tscv-0.0.3.tar.gz", "has_sig": false, "md5_digest": "3a08eff11bb6a67efc371a5488b7f4c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7436, "upload_time": "2019-05-19T09:47:41", "url": "https://files.pythonhosted.org/packages/cc/36/8bb7b9813134e9d78fa7fc3ea1f58acb25b28057b04aa37bf761f5260e5e/tscv-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b0880a04cbf84fffdb6c314ba3f050e7", "sha256": "d21d975829893e25b488261c4666ec0354e8b0547dfe6429786901b6f28602b0" }, "downloads": -1, "filename": "tscv-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "b0880a04cbf84fffdb6c314ba3f050e7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8816, "upload_time": "2019-05-19T09:47:38", "url": "https://files.pythonhosted.org/packages/14/04/fe3e2eb3a76b63ef89f8788a70627f9a659a6c7b84f1ef504dba869ef8a7/tscv-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3a08eff11bb6a67efc371a5488b7f4c9", "sha256": "e4913737333f269b7429f30923d75280124e91c1af77b447841b79d8bcb37758" }, "downloads": -1, "filename": "tscv-0.0.3.tar.gz", "has_sig": false, "md5_digest": "3a08eff11bb6a67efc371a5488b7f4c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7436, "upload_time": "2019-05-19T09:47:41", "url": "https://files.pythonhosted.org/packages/cc/36/8bb7b9813134e9d78fa7fc3ea1f58acb25b28057b04aa37bf761f5260e5e/tscv-0.0.3.tar.gz" } ] }