I assume you're passing in the keyword arg cv=10
to the LassoCV
constructor?
If this is the case, then this will create a KFold
object with 10 folds: take a look at where check_cv
is called in LinearModelCV
(LassoCV
's parent).
KFold
takes a random_state
keyword argument (which defaults to None – so numpy.random
will try to seed on /dev/urandom
or something similar) – but if shuffle is False
(which it is by default), then random_state
doesn't actually do anything. The folds are selected from adjacent members in the data set.
If you want to randomise the folds, you should create a KFold
object with shuffle=True
, and use that object as the cv
keyword argument, instead of 10
.
Sources: