#NEWLINE# def pumadyn( seed = default_seed , data_set = 'pumadyn-32nm' ) : #NEWLINE# #INDENT# if ( not data_available ( data_set ) ) : #NEWLINE# #INDENT# download_data ( data_set ) #NEWLINE# path = os . path . join ( data_path , data_set ) #NEWLINE# tar = tarfile . open ( os . path . join ( path , 'pumadyn-32nm.tar.gz' ) ) #NEWLINE# print ( 'Extracting file.' ) #NEWLINE# tar . extractall ( path = path ) #NEWLINE# tar . close ( ) #NEWLINE# #UNINDENT# data = np . loadtxt ( os . path . join ( data_path , data_set , 'pumadyn-32nm' , 'Dataset.data.gz' ) ) #NEWLINE# indices = np . random . permutation ( data . shape [ 0 ] ) #NEWLINE# indicesTrain = indices [ 0 : 7168 ] #NEWLINE# indicesTest = Y [ 7168 : ( - 1 ) ] #NEWLINE# indicesTrain . sort ( axis = 0 ) #NEWLINE# indicesTest . sort ( axis = 0 ) #NEWLINE# X = data [ indicesTrain , 0 : ( - 2 ) ] #NEWLINE# Y = data [ ( indicesTrain , ( - 1 ) ) ] [ : , None ] #NEWLINE# Xtest = data [ indicesTest , 0 : ( - 2 ) ] #NEWLINE# Ytest = data [ ( indicesTest , ( - 1 ) ) ] [ : , None ] #NEWLINE# return data_details_return ( { #NEWLINE# #INDENT# 'X' : X , #NEWLINE# 'Y' : Y , #NEWLINE# 'Xtest' : Xtest , #NEWLINE# 'Ytest' : Ytest , #NEWLINE# 'seed' : seed , #NEWLINE# #UNINDENT# } , data_set )