My current code looks like
from vecstack import stacking
all_models = [model1, model2, model3]
s_train, s_test = stacking(all_models, X_train, y_train, X_test, regression=False, n_folds=4)
Model1 is xgboost, model2 is randomforestclassifier, model3 is logisticregression. XGBoost can handle Nans, the other two cannot. I filled the Nans with the mean for models 2 and 3 and got decent results. Now I want to stack them, but run into this problem where I want the X_train and X_test to replace Nans with mean for only 2 of the 3 models