I'm writing a function like this
def split_into_train_and_test(x_all_LF, frac_test=0.5, random_state=None):
The function is passed in like this
split_into_train_and_test(x_LF, frac_test=0.3, random_state=np.random.RandomState(0))
Currently I am using this to get the random seed, but it's not working.
if random_state is None:
random_state = np.random
else:
np.random.seed(random_state)
np.shuffle(x_all_LF)
How do I extract the random seed with np.random.RandomState(0).