Skip to content

Results are different between on Mac and on Windows #533

Description

@hideaki

Thank you for creating this wonderful package.
I tried the following example on Mac and Windows, and it seems that the results are different.
I was expecting the same results since the same seed was set, but is this difference expected?

Script to reproduce:

library(ranger)
set.seed(1)
c <- ranger(Species ~ ., data = iris, seed=NULL, num.trees = 1, importance = "impurity", num.threads = 1)
print(c)
c$variable.importance

Mac result:

> print(c)
Ranger result

Call:
 ranger(Species ~ ., data = iris, seed = NULL, num.trees = 1,      importance = "impurity", num.threads = 1) 

Type:                             Classification 
Number of trees:                  1 
Sample size:                      150 
Number of independent variables:  4 
Mtry:                             2 
Target node size:                 1 
Variable importance mode:         impurity 
Splitrule:                        gini 
OOB prediction error:             10.77 % 
> c$variable.importance
Sepal.Length  Sepal.Width Petal.Length  Petal.Width 
   20.405419     0.000000    75.928635     1.945946 
> 

Windows result:

> print(c)
Ranger result

Call:
 ranger(Species ~ ., data = iris, seed = NULL, num.trees = 1,      importance = "impurity", num.threads = 1) 

Type:                             Classification 
Number of trees:                  1 
Sample size:                      150 
Number of independent variables:  4 
Mtry:                             2 
Target node size:                 1 
Variable importance mode:         impurity 
Splitrule:                        gini 
OOB prediction error:             7.69 % 
> c$variable.importance
Sepal.Length  Sepal.Width Petal.Length  Petal.Width 
    2.641367     0.000000     5.873265    91.365368 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions