FarrellDay / miceRanger

miceRanger: Fast Imputation with Random Forests in R
Other
67 stars 12 forks source link

Different imputed Values for the same observation #11

Closed statunizaga closed 3 years ago

statunizaga commented 3 years ago

Hi, im gonna show you what i was talking about. Try this: require(miceRanger) require(dplyr)

Creating 2 data sets with the same observation

data(iris) set.seed(1) ampIris <- amputeData(iris,perc=0.25)

ampIris$id <- 1:150 miceObj <- miceRanger(ampIris,verbose=FALSE,returnModels = TRUE) set.seed(1) i1 = impute(ampIris,miceObj)

set.seed(1) ampIris2 <- ampIris %>% filter(id==1) %>% bind_rows(ampIris %>% filter(id!=1) %>% head(15)) i2 = impute(ampIris2,miceObj)

Selecting the id =1

ampIris %>% filter(id==1)

i1$imputedData$Dataset_3 %>% filter(id==1)

i2$imputedData$Dataset_3 %>% filter(id==1)

you can see that for the same observation has different imputed values in petal.length and even setting the seed.