if not self.use_features_in_secondary:
self.meta_regr_.fit(meta_features, y)
elif sparse.issparse(X):
self.meta_regr_.fit(sparse.hstack((X, meta_features)), y)
else:
self.meta_regr_.fit(np.hstack((X, meta_features)), y)
// Retrain base models on all data
for regr in self.regr_:
After Change
if sample_weight is None:
instance.fit(X[train_idx], y[train_idx])
else:
instance.fit(X[train_idx], y[train_idx],
sample_weight=sample_weight[train_idx])
y_pred = instance.predict(X[holdout_idx])
meta_features[holdout_idx, i] = y_pred