-
Notifications
You must be signed in to change notification settings - Fork 5
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
Expose random number seed #4
Comments
Hm, I think I remember why we didn't do this in the first place, since it seems like an obvious oversight: the libsvm API
doesn't expose anywhere to set the random seed. |
I read the source and it seems that it's just using the standard rand(): which means we can control it with |
That raises another issue though: do we seed at loading the library, or do we seed each time we call svmachines? If we seed each time we run svmachines, that will crash up against any other library that uses Practically, it's probably more important to avoid conflicts than to catch reseeds, because reseeds are bad statistical pratice. But that would have to come with huge caveats in the docs. |
In Stata, it is common practice to start examples with
set seed
to ensure replicability. But this is currently impossible if your problem involvessvmachines
because libsvm has its own random seeding involved.We need to find a way to seed the libsvm seed in order to make runs consistent; we could either seed it from the Stata seed, or maybe expose it as a separate optional parameter.
EDIT: StataCorp recommends recording
c(rngstate)
in your output dataset and recovering it byset rngstate
and notset state
if you need to rerun it.The text was updated successfully, but these errors were encountered: