Comments (3)
Agree. A make_indexer
function would be a great utility to convert any list of train-test splits of fold generator into a mlens compatible indexer. Actually think the mlens.index
code base (in 0.2.0
) already has the base code needed for that, worth looking into!
Come think of it, the time series indexer is quite straightforward to implement as the folds are contiguous:
# Params
require: burn_in
require: window_size
require: test_size
start_index = 0
stop_index = burn_in
stop = False
while not stop:
start_index += window_size # if moving window
stop_index += window_size
if stop_index + test_size >= X.shape[0]:
stop = True
# Something here to grab the last obs in the final fold
train_index = (start_index, stop_index)
test_index = (stop_index, stop_index + test_size) # test_size might not always be 1?
yield train_index, test_index
or something like it maybe.
from mlens.
This would be great.
In addition, it would be useful to add in a base training size e.g. 3 (of the 6 "folds"). This better mimics many real life scenarios where you have a good amount of training data with an expanding window.
fold | train obs | test obs |
---|---|---|
0 | 0, 1, 2, 3 | 4 |
1 | 0, 1, 2, 3, 4 | 5 |
2 | 0, 1, 2, 3, 4, 5 | 6 |
It would also be useful to include a moving window size, e.g. 4 (on 6 folds)
fold | train obs | test obs |
---|---|---|
0 | 0, 1, 2, 3 | 4 |
1 | 1, 2, 3, 4 | 5 |
2 | 2, 3, 4, 5 | 6 |
Ultimately, this could all be achieved by allowing a user to define their own indices for the train-test-split.
from mlens.
Resolved in #95.
from mlens.
Related Issues (20)
- OSError: [Errno 24] Too many open files HOT 1
- Serialize mlens superlearner with KerasRegressor inside HOT 1
- mlen superlearner for MIMO multi-input multi-output HOT 2
- Error when using sklearn StratifiedKFold in Evaluator CV HOT 1
- getting zero score accuracy on test data
- If I already have trained models, how can I use mlens HOT 3
- confirmation
- Save / Restore model HOT 5
- How do I know the weight of the base model assigned by the meta model?
- Adding custom models in the superlearner
- Apply preprocessing to target variable as well
- Monotonic constraints
- Error when using preprocessing per case in model selection HOT 2
- Error involving Collections Module
- Getting error when executing the ensemble.fit(X_train, y_train) command HOT 1
- Prediction failing with 1 row of test data
- why the predict_proba() function do not return the probabilities?
- Error while running ensemble.fit(X_train, y_train)
- Error in index/base.py when using NumPy 1.24 or higher - Replace `np.int` with `np.int_`
- Superlearnerl on google colab (python 3.10 or 3.7) HOT 3
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 mlens.