yuenshingyan/MissForest

mf.transform(x=test) gives error

kawseribn opened this issue · 3 comments

rgr = RandomForestRegressor(n_jobs=-1)

mf = MissForest(clf, rgr)
mf.fit(X_missing)

X_imputed = mf.transform(X_missing)

x_test_imputed = mf.transform(x=test) #this generates the error
image

Is that possible to give me the dataset and full code, since it is hard to re-create the bug without them ?

the issue comes from training using .fit_transform and then attempting to transform on new data. It seems the trained object will expect a new dataset at least the size of the trained dataset, but in reality, you may want to just transform just one row.

I have fixed the bug and also added some simple tests. https://pypi.org/project/MissForest/