We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi there,
First of all great job on stratification - it is already very useful in our recent project :)
I encountered small issue tho I'm trying to use IterativeStratification and one it's parameters, random_state seems to be a trap
IterativeStratification
random_state
This code works fine:
from skmultilearn.model_selection import IterativeStratification test_size = 0.2 stratifier = IterativeStratification( n_splits=2, order=2, sample_distribution_per_fold=[ test_size, 1.0 - test_size], ) train_indices, test_indices = next( stratifier.split( X=np.random.random((100,4)), y=(np.random.random((100,4)) > 0.5).astype(int) ) )
while this
from skmultilearn.model_selection import IterativeStratification test_size = 0.2 stratifier = IterativeStratification( n_splits=2, order=2, sample_distribution_per_fold=[ test_size, 1.0 - test_size], random_state = 42 ) train_indices, test_indices = next( stratifier.split( X=np.random.random((100,4)), y=(np.random.random((100,4)) > 0.5).astype(int) ) )
produces
ValueError: Setting a random_state has no effect since shuffle is False. You should leave random_state to its default (None), or set shuffle=True.
but shuffle is hardcoded as False in IterativeStratification super class call
shuffle
False
scikit-multilearn/skmultilearn/model_selection/iterative_stratification.py
Line 184 in e6eabf0
The text was updated successfully, but these errors were encountered:
that seems to be related to #234
Sorry, something went wrong.
#248 gives the fix for IterativeStratification.
I was able to do a workaround using numpy.random.seed.
numpy.random.seed
No branches or pull requests
Hi there,
First of all great job on stratification - it is already very useful in our recent project :)
I encountered small issue tho
I'm trying to use
IterativeStratification
and one it's parameters,random_state
seems to be a trapThis code works fine:
while this
produces
but
shuffle
is hardcoded asFalse
inIterativeStratification
super class callscikit-multilearn/skmultilearn/model_selection/iterative_stratification.py
Line 184 in e6eabf0
The text was updated successfully, but these errors were encountered: