#NEWLINE# def gen_samples( self , y , n_samples , problem_type ) : #NEWLINE# #INDENT# if ( problem_type == 'classification' ) : #NEWLINE# #INDENT# folds = StratifiedKFold ( y , n_folds = n_samples ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# folds = KFold ( y . size , n_folds = n_samples ) #NEWLINE# #UNINDENT# for ( train , cal ) in folds : #NEWLINE# #INDENT# ( yield ( train , cal ) )