def _cross_val(data, est, cv, n_jobs):
 try:
  from sklearn.model_selection import cross_val_score
 except ImportError:
  from sklearn.cross_validation import cross_val_score
 return np.mean(cross_val_score(est, data, cv=cv, n_jobs=n_jobs, scoring=_gaussian_loglik_scorer))

def _cross_val ( data , est , cv , n_jobs ) : try : from sklearn . model_selection import cross_val_score except ImportError : from sklearn . cross_validation import cross_val_score return np . mean ( cross_val_score ( est , data , cv = cv , n_jobs = n_jobs , scoring = _gaussian_loglik_scorer ) )
helper to compute cross validation .