def _gl_score(estimators, scoring, X, y):
 n_iter = X.shape[(-1)]
 n_est = len(estimators)
 for (ii, est) in enumerate(estimators):
  for jj in range(X.shape[(-1)]):
   if (scoring is not None):
    _score = scoring(est, X[..., jj], y)
   else:
    _score = est.score(X[..., jj], y)
   if ((ii == 0) & (jj == 0)):
    if isinstance(_score, np.ndarray):
     dtype = _score.dtype
     shape = np.r_[(n_est, n_iter, _score.shape)]
    else:
     dtype = type(_score)
     shape = [n_est, n_iter]
    score = np.zeros(shape, dtype)
   score[ii, jj, ...] = _score
 return score

def _gl_score ( estimators , scoring , X , y ) : n_iter = X . shape [ ( - 1 ) ] n_est = len ( estimators ) for ( ii , est ) in enumerate ( estimators ) : for jj in range ( X . shape [ ( - 1 ) ] ) : if ( scoring is not None ) : _score = scoring ( est , X [ ... , jj ] , y ) else : _score = est . score ( X [ ... , jj ] , y ) if ( ( ii == 0 ) & ( jj == 0 ) ) : if isinstance ( _score , np . ndarray ) : dtype = _score . dtype shape = np . r_ [ ( n_est , n_iter , _score . shape ) ] else : dtype = type ( _score ) shape = [ n_est , n_iter ] score = np . zeros ( shape , dtype ) score [ ii , jj , ... ] = _score return score
score _generalizationlight in parallel .