#NEWLINE# def predict_proba( self , X ) : #NEWLINE# #INDENT# 'Predict class probabilities for X.\n\n        The predicted class probabilities of an input sample is computed as\n        the mean predicted class probabilities of the trees in the forest. The\n        class probability of a single tree is the fraction of samples of the same\n        class in a leaf.\n\n        Parameters\n        ----------\n        X : array-like or sparse matrix of shape = [n_samples, n_features]\n            The input samples. Internally, it will be converted to\n            ``dtype=np.float32`` and if a sparse matrix is provided\n            to a sparse ``csr_matrix``.\n\n        Returns\n        -------\n        p : array of shape = [n_samples, n_classes], or a list of n_outputs\n            such arrays if n_outputs > 1.\n            The class probabilities of the input samples. The order of the\n            classes corresponds to that in the attribute `classes_`.\n        ' #NEWLINE# X = self . _validate_X_predict ( X ) #NEWLINE# ( n_jobs , _ , _ ) = _partition_estimators ( self . n_estimators , self . n_jobs ) #NEWLINE# all_proba = Parallel ( n_jobs = n_jobs , verbose = self . verbose , backend = 'threading' ) ( ( delayed ( parallel_helper ) ( e , 'predict_proba' , X , check_input = False ) for e in self . estimators_ ) ) #NEWLINE# proba = all_proba [ 0 ] #NEWLINE# if ( self . n_outputs_ == 1 ) : #NEWLINE# #INDENT# for j in range ( 1 , len ( all_proba ) ) : #NEWLINE# #INDENT# proba += all_proba [ j ] #NEWLINE# #UNINDENT# proba /= len ( self . estimators_ ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for j in range ( 1 , len ( all_proba ) ) : #NEWLINE# #INDENT# for k in range ( self . n_outputs_ ) : #NEWLINE# #INDENT# proba [ k ] += all_proba [ j ] [ k ] #NEWLINE# #UNINDENT# #UNINDENT# for k in range ( self . n_outputs_ ) : #NEWLINE# #INDENT# proba [ k ] /= self . n_estimators #NEWLINE# #UNINDENT# #UNINDENT# return proba