mrpargeter
mrpargeter

Reputation: 329

Does the glmulti function (from the gmulti package) need a set.seed value?

I am using glmulti to select a set of candidate generalized linear models and my variable importance values and 'best' model keep changing each time I run the model.

I am struggling to understand why this is, does glmulti need a set.seed value to make results reproducible?

Thanks.

Upvotes: 1

Views: 365

Answers (2)

GClarke
GClarke

Reputation: 35

As long as you use (method = "h") then the function will run through ALL possible models and you will get the same output every time. This is obviously computationally intensive, but if you are using the best subsets approach that glmulti is meant for, this is what you want anyway... You should not use glmulti with the genetic algorithm (method = "g") for anything other than a quick overview of possible effects in your data. If you're looking for a less computationally intensive method, there are other more appropriate machine learning algorithms (e.g. elastic net)

Upvotes: 0

user2554330
user2554330

Reputation: 44957

I believe the glmulti function is in the glmulti package. (You should state this in your question...) If so, the help page says that sometimes it uses a genetic algorithm to find the best model. Those are indeed random algorithms, so you can expect to get an answer that depends on the random number seed.

Upvotes: 1

Related Questions