def validation_curve(estimator, X, y, param_name, param_range, groups=None, cv=None, scoring=None, n_jobs=1, pre_dispatch='all', verbose=0):
 (X, y, groups) = indexable(X, y, groups)
 cv = check_cv(cv, y, classifier=is_classifier(estimator))
 scorer = check_scoring(estimator, scoring=scoring)
 parallel = Parallel(n_jobs=n_jobs, pre_dispatch=pre_dispatch, verbose=verbose)
 out = parallel((delayed(_fit_and_score)(estimator, X, y, scorer, train, test, verbose, parameters={param_name: v}, fit_params=None, return_train_score=True) for (train, test) in cv.split(X, y, groups) for v in param_range))
 out = np.asarray(out)
 n_params = len(param_range)
 n_cv_folds = (out.shape[0] // n_params)
 out = out.reshape(n_cv_folds, n_params, 2).transpose((2, 1, 0))
 return (out[0], out[1])

def validation_curve ( estimator , X , y , param_name , param_range , groups = None , cv = None , scoring = None , n_jobs = 1 , pre_dispatch = 'all' , verbose = 0 ) : ( X , y , groups ) = indexable ( X , y , groups ) cv = check_cv ( cv , y , classifier = is_classifier ( estimator ) ) scorer = check_scoring ( estimator , scoring = scoring ) parallel = Parallel ( n_jobs = n_jobs , pre_dispatch = pre_dispatch , verbose = verbose ) out = parallel ( ( delayed ( _fit_and_score ) ( estimator , X , y , scorer , train , test , verbose , parameters = { param_name : v } , fit_params = None , return_train_score = True ) for ( train , test ) in cv . split ( X , y , groups ) for v in param_range ) ) out = np . asarray ( out ) n_params = len ( param_range ) n_cv_folds = ( out . shape [ 0 ] // n_params ) out = out . reshape ( n_cv_folds , n_params , 2 ) . transpose ( ( 2 , 1 , 0 ) ) return ( out [ 0 ] , out [ 1 ] )
validation curve .