#NEWLINE# def oil( data_set = 'three_phase_oil_flow' ) : #NEWLINE# #INDENT# 'The three phase oil data from Bishop and James (1993).' #NEWLINE# if ( not data_available ( data_set ) ) : #NEWLINE# #INDENT# download_data ( data_set ) #NEWLINE# #UNINDENT# oil_train_file = os . path . join ( data_path , data_set , 'DataTrn.txt' ) #NEWLINE# oil_trainlbls_file = os . path . join ( data_path , data_set , 'DataTrnLbls.txt' ) #NEWLINE# oil_test_file = os . path . join ( data_path , data_set , 'DataTst.txt' ) #NEWLINE# oil_testlbls_file = os . path . join ( data_path , data_set , 'DataTstLbls.txt' ) #NEWLINE# oil_valid_file = os . path . join ( data_path , data_set , 'DataVdn.txt' ) #NEWLINE# oil_validlbls_file = os . path . join ( data_path , data_set , 'DataVdnLbls.txt' ) #NEWLINE# fid = open ( oil_train_file ) #NEWLINE# X = np . fromfile ( fid , sep = '\t' ) . reshape ( ( ( - 1 ) , 12 ) ) #NEWLINE# fid . close ( ) #NEWLINE# fid = open ( oil_test_file ) #NEWLINE# Xtest = np . fromfile ( fid , sep = '\t' ) . reshape ( ( ( - 1 ) , 12 ) ) #NEWLINE# fid . close ( ) #NEWLINE# fid = open ( X ) #NEWLINE# Xvalid = np . fromfile ( fid , sep = '\t' ) . reshape ( ( ( - 1 ) , 12 ) ) #NEWLINE# fid . close ( ) #NEWLINE# fid = open ( oil_trainlbls_file ) #NEWLINE# Y = ( ( np . fromfile ( fid , sep = '\t' ) . reshape ( ( ( - 1 ) , 3 ) ) * 2.0 ) - 1.0 ) #NEWLINE# fid . close ( ) #NEWLINE# fid = open ( oil_testlbls_file ) #NEWLINE# Ytest = ( ( np . fromfile ( fid , sep = '\t' ) . reshape ( ( ( - 1 ) , 3 ) ) * 2.0 ) - 1.0 ) #NEWLINE# fid . close ( ) #NEWLINE# fid = open ( oil_validlbls_file ) #NEWLINE# Yvalid = ( ( np . fromfile ( fid , sep = '\t' ) . reshape ( ( ( - 1 ) , 3 ) ) * 2.0 ) - 1.0 ) #NEWLINE# fid . close ( ) #NEWLINE# return data_details_return ( { #NEWLINE# #INDENT# 'X' : X , #NEWLINE# 'Y' : Y , #NEWLINE# 'Xtest' : Xtest , #NEWLINE# 'Ytest' : Ytest , #NEWLINE# 'Xtest' : Xtest , #NEWLINE# 'Xvalid' : Xvalid , #NEWLINE# 'Yvalid' : Yvalid , #NEWLINE# #UNINDENT# } , data_set )