Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Within Session splitter #664
base: develop
Are you sure you want to change the base?
Within Session splitter #664
Changes from all commits
bacedc5
419b2ca
d6e795d
140670c
d724674
a278026
300a6b9
7cb79f6
55db70f
2851a15
c73dd1a
2b0e735
cf4b709
177bf65
a6b5772
26b13d5
e6661c4
430e3a8
698e539
0fff053
98d12ac
558d27b
34ea645
b435bf8
d8f26a3
eaf0fb9
e5159f2
516a5e8
b29ecd2
37cff03
88ee910
ea9cc59
819c4ff
65c305e
f1ad587
485e7a5
3f3742f
c181c59
8f034c8
fbef726
837c061
34822e9
39e92e5
612c6a6
590edb1
b151d61
602ccd5
74cf246
c85928d
f3020ee
c628fd7
83e425f
a785ef7
686572e
8f8ada9
b87cf25
42e6b7b
f66878a
71cebb1
a948175
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the scikit-learn framework,
cv
is a cross-validator object, not a class. I think it would be best to stick to it. This would avoid to instantiate it during thesplit
call. You can havesplit=None
by default and instantiatecv=StratifiedKFold()
class in the__init__
method.Also, you can check the cf argument with sklearn’s
check_cv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the concern, but I'm a bit unsure on how to implement it in the case shuffle=True, since I'm defining a different seed for each (subject, session). The suggestion is to instantiate cv in the init method in case split is not needed, and keep how it is being done otherwise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed it's not easy. But you could for example make a wrapper around
StratifiedKFolds
which would instantiate a different cv with a different seed for each subject/session.Also I just noticed that at the moment, the seeds for each subject/session are chosen at random. We will not be able to have reproducible results this way. Instead, you could add a parameter
global_seed
to your wrapper and use, for each cv,random_state = global_seed + 10000*subject_number + session_number
(it's safe to say we will never have 10000 sessions) ifglobal_seed
is an integer and none otherwiseThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is important to check if the split is the same when we load the data of one/a few subject(s) only,
paradigm.get_data(dataset=dataset, subjects=[m, n...])