check_is_fitted(self, "clfs_")
all_model_predictions = np.array([]).reshape(len(X), 0)
for model in self.clfs_:
if not self.use_probas:
single_model_prediction = model.predict(X)
After Change
check_is_fitted(self, ["clfs_", "meta_clf_"])
per_model_preds = []
for model in self.clfs_:
if not self.use_probas:
prediction = model.predict(X)[:, np.newaxis]
else:
prediction = model.predict_proba(X)
per_model_preds.append(prediction)
return np.hstack(per_model_preds)
def _stack_first_level_features(self, X, meta_features):
if sparse.issparse(X):
stack_fn = sparse.hstack