Comments (3)
The data set is assumed to be in time order, though an explicit datatime column is not required. It should work on lists, arrays, dataframes. If not, please report a bug.
The following example comes from my blog post:
import numpy as np
from tscv import gap_train_test_split
X, y = np.arange(20).reshape((10, 2)), np.arange(10)
X_train, X_test, y_train, y_test = gap_train_test_split(X, y, test_size=2, gap_size=2)
In the example, X
and y
are numpy arrays. They don't have data time information, but they represent time-ordered data.
from tscv.
Thank you for clarifying. I eventually figured it out when I saw a reference in the code comments.
I recommend you make it clear in your documentation.
Also, do you have a layout recommendations/guidance on how to set combination layouts of split/test size/gap size?
I made some guesses when using and in some cases got errors. I'm using GapWalkForward and given that it ignores data after the test set I'm trying to easy figure exactly what I'm using in the folds so I'm making best use of data.
Thank you so much for creating and publishing this package
from tscv.
The documentation part is on the roadmap (see the v0.1.0
milestone).
do you have a layout recommendations/guidance on how to set combination layouts of split/test size/gap size?
This topic is publication worthy. There is no single fixed rule that can handle all cases, and many heuristics are available for choice. I do have some professional insight on this issue, but they cannot be made clear within a couple of sentences. I can give you some quick and dirty advice though: try some small gap sizes and check whether your conclusion stays the same with and without the gaps (cf. stress test and scenario analysis).
from tscv.
Related Issues (20)
- [Docs] Use this package for Nested Cross-Validation
- Intution on setting number of gaps HOT 1
- split.py depends on deprecated / newly private method `_safe_indexing` in scikit-learn 0.24.0 HOT 3
- Stratify? HOT 1
- Double count in `n_splits` in `GapLeavePOut` HOT 1
- Improve the user experience of `gap_train_test_split`
- Retrained version of GapWalkForward: GapRollForward HOT 1
- Continuous Integration
- Documentation
- Warning once is not enough HOT 1
- GapWalkForward Issue with Scikit-learn 0.24.1 HOT 2
- Deprecation message for `GapWalkForward` HOT 1
- Publish on conda
- Implement Rep-Holdout HOT 11
- Error when Importing TSCV Gapwalkforward HOT 2
- Import error with latest sklearn version HOT 3
- Does this work with sklearn 1.2? HOT 4
- GapKFold CV not working with sklearn cross_val_predict HOT 1
- GapLeavePOut CV not working with sklearn cross_val_predict HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tscv.