#NEWLINE# def build_dataset( X , y , method_conf , cv_conf , outputdir = '.' , grid = None , verbose = False , compress = 0 ) : #NEWLINE# #INDENT# 'Write the dataset file.\n    ' #NEWLINE# n_samples = X . shape [ 0 ] #NEWLINE# n_targets = ( 1 if ( outputdir . ndim == 1 ) else y . shape [ 1 ] ) #NEWLINE# if ( n_targets > 1 ) : #NEWLINE# #INDENT# warnings . warn ( 'More than one target. Unexpected results or crashes may occur if your methods and/or metrics cannot handle multiple targets.' , RuntimeWarning ) #NEWLINE# #UNINDENT# output_file = path . join ( outputdir , 'dataset.joblib' ) #NEWLINE# folds = dict ( make_folds ( y , cv_conf , verbose = verbose ) , src = path . basename ( output_file ) ) #NEWLINE# if verbose : #NEWLINE# #INDENT# print ( 'Input dataset destination: {}' . format ( output_file ) ) #NEWLINE# #UNINDENT# dataset = { #NEWLINE# #INDENT# 'X' : X , #NEWLINE# 'Y' : y , #NEWLINE# 'n_samples' : n_samples , #NEWLINE# 'n_targets' : n_targets , #NEWLINE# 'folds' : folds , #NEWLINE# 'grid' : grid , #NEWLINE# #UNINDENT# } #NEWLINE# joblib . dump ( dataset , output_file , compress = compress ) #NEWLINE# return dataset