I am trying to construct a stacking classifier for predicting each class, at the same time I need the probability for each elemnt to be in the predicted class. I tried using the predict_proba() method but I seem to run to the same error "'StackingClassifier' object has no attribute 'pedict_proba'". Please help!
hgbm = HistGradientBoostingClassifier(l2_regularization=3, learning_rate=0.5, random_state=42, class_weight="balanced")
bbc = BalancedBaggingClassifier(
estimator = hgbm,
n_estimators = 10,
random_state = 42,
n_jobs = -1,
)
brf = BalancedRandomForestClassifier(n_estimators = 200, random_state = 42, n_jobs = -1)
CLF = RidgeClassifier(random_state = 42, alpha = 0.8, max_iter = 200, class_weight = 'balanced')
Class_st = StackingClassifier(estimators=[("BalancedBaggingClassifier", bbc),
("BalancedRandomForestClassifier", brf)],
final_estimator = CLF, stack_method='predict_proba', cv = 5, n_jobs = -1)
Class_st.fit(X_train, y_train)
prob = Class_st.pedict_proba(X_test)
The error:
'StackingClassifier' object has no attribute 'pedict_proba'