parameters: (estimators, estimators_features, X, n_classes)
return_statement: return proba
docstring: Private function used to compute (proba-)predictions within a job.
docstring_summary: Private function used to compute (proba-)predictions within a job.
docstring_tokens: Private function used to compute ( proba - ) predictions within a job .
function: def _parallel_predict_proba(estimators, estimators_features, X, n_classes):
      """Private function used to compute (proba-)predictions within a job."""
      n_samples = X.shape[0]
      proba = np.zeros((n_samples, n_classes))
  
      for estimator, features in zip(estimators, estimators_features):
          if hasattr(estimator, "predict_proba"):
              proba_estimator = estimator.predict_proba(X[:, features])
  
              if n_classes == len(estimator.classes_):
                  proba += proba_estimator
  
              else:
                  proba[:, estimator.classes_] += \
                      proba_estimator[:, range(len(estimator.classes_))]
  
          else:
              # Resort to voting
              predictions = estimator.predict(X[:, features])
  
              for i in range(n_samples):
                  proba[i, predictions[i]] += 1
  
      return proba
function_tokens: def _parallel_predict_proba ( estimators , estimators_features , X , n_classes ) : n_samples = X . shape [ 0 ] proba = np . zeros ( ( n_samples , n_classes ) ) for estimator , features in zip ( estimators , estimators_features ) : if hasattr ( estimator , "predict_proba" ) : proba_estimator = estimator . predict_proba ( X [ : , features ] ) if n_classes == len ( estimator . classes_ ) : proba += proba_estimator else : proba [ : , estimator . classes_ ] += proba_estimator [ : , range ( len ( estimator . classes_ ) ) ] else : # Resort to voting predictions = estimator . predict ( X [ : , features ] ) for i in range ( n_samples ) : proba [ i , predictions [ i ] ] += 1 return proba