#NEWLINE# def gen_samples( self , y , n_samples , problem_type ) : #NEWLINE# #INDENT# if ( problem_type == 'classification' ) : #NEWLINE# #INDENT# splits = StratifiedShuffleSplit ( y , n_iter = n_samples , test_size = self . cal_portion ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# splits = ShuffleSplit ( problem_type . size , n_iter = n_samples , test_size = self . cal_portion ) #NEWLINE# #UNINDENT# for ( train , cal ) in splits : #NEWLINE# #INDENT# ( yield ( train , cal ) )