File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,31 @@ def predict(self, X):
181
181
182
182
return self .stacking_estimator .predict (predictions_ )
183
183
184
+ def predict_proba (self , X ):
185
+ """Predict class probability for samples in X.
186
+
187
+ Parameters
188
+ ----------
189
+ X : {array-like, sparse matrix}, shape = (n_samples, n_features)
190
+ The multi-input samples.
191
+
192
+ Returns
193
+ -------
194
+ C : array, shape = (n_samples)
195
+ Predicted class label per sample.
196
+ """
197
+ _check_Xy (self , X )
198
+ X_list = _split_features (X , self .feature_indices )
199
+ predictions_ = Parallel (n_jobs = self .n_jobs )(
200
+ delayed (_predict_proba_estimator )(clf , x )
201
+ for x , clf in zip (X_list , self .estimators ))
202
+ predictions_ = np .array (predictions_ ).T
203
+
204
+ return _predict_proba_estimator (self .stacking_estimator , predictions_ )
205
+
206
+ def decision_function (self , X ):
207
+ return self .predict_proba (X )
208
+
184
209
def score (self , X , y ):
185
210
"""Returns the mean accuracy on the given test data and labels.
186
211
You can’t perform that action at this time.
0 commit comments