original_docstring:  
          Compute the correlation coefficient
          amongst different phases 
      
docstring: Compute the correlation coefficient
  amongst different phases
docstring_tokens: Compute the correlation coefficient amongst different phases
code: def compute_correlation():
      """ 
          Compute the correlation coefficient
          amongst different phases 
      """
      w = 100
      m = 22
  
      N     = 5000
      ds    = np.full((7,N),-1.7)
      r     = np.full((7,7),-10.8)
      # Collect ph1s1 dataset
      mfile = "raw-execution-data/ecolab-knl-2018-10-19/alloc_prbs-"+str(w)+"_cores-"+str(m)
      
      tmp              = pd.read_csv(mfile+"/dataset_ph1.csv")
      tmp1             = tmp[tmp['t2'] > 0]
      tmp1['sum']      = tmp1.apply(lambda row : (row.t1 + row.t2 + row.t3)/1000.0,axis=1)
      tmp2             = tmp1['sum'].values
      ph1s1            = [tmp2[idx] for idx,val in enumerate(tmp2) if (idx//16) % 2 == 0]
      ds[0,:]          = ptsl.inv_transform_sampling_dataset(ph1s1,N)
      ph1s2            = [tmp2[idx] for idx,val in enumerate(tmp2) if (idx//16) % 2 == 1]
      ds[3,:]          = ptsl.inv_transform_sampling_dataset(ph1s2,N)
      
      tmp              = pd.read_csv(mfile+"/dataset_ph2.csv")
      tmp1             = tmp[tmp['t2'] > 0]
      tmp1['sum']      = tmp1.apply(lambda row : (row.t1 + row.t2 + row.t3)/1000.0,axis=1)
      tmp2             = tmp1['sum'].values
      ph2s1            = [tmp2[idx] for idx,val in enumerate(tmp2) if (idx//16) % 2 == 0]
      ds[1,:]          = ptsl.inv_transform_sampling_dataset(ph2s1,N)
      ph2s2            = [tmp2[idx] for idx,val in enumerate(tmp2) if (idx//16) % 2 == 1]
      ds[4,:]          = ptsl.inv_transform_sampling_dataset(ph2s2,N)
  
      tmp              = pd.read_csv(mfile+"/dataset_ph3.csv")
      tmp1             = tmp[tmp['t2'] > 0]
      tmp1['sum']      = tmp1.apply(lambda row : (row.t1 + row.t2 + row.t3)/1000.0,axis=1)
      tmp2             = tmp1['sum'].values
      ph3s1            = [tmp2[idx] for idx,val in enumerate(tmp2) if (idx//16) % 2 == 0]
      ds[2,:]          = ptsl.inv_transform_sampling_dataset(ph3s1,N)
      ph3s2            = [tmp2[idx] for idx,val in enumerate(tmp2) if (idx//16) % 2 == 1]
      ds[5,:]          = ptsl.inv_transform_sampling_dataset(ph3s2,N)
  
      tmp              = pd.read_csv(mfile+"/dataset_ph4.csv")
      tmp1             = tmp[tmp['t2'] > 0]
      tmp1['sum']      = tmp1.apply(lambda row : (row.t1 + row.t2 + row.t3)/1000.0,axis=1)
      ph4              = tmp1['sum'].values
      ds[6,:]          = ptsl.inv_transform_sampling_dataset(ph4,N)
  
  
      # Compute the pearson correaltion coefficient
      for i in range(0,7):
          for j in range(0,7):
              r[i,j],_ = stats.pearsonr(ds[i,:],ds[j,:])
      df = pd.DataFrame(r)
      xfile = "r-w"+str(w)+"-m"+str(m)+".xlsx"
      df.to_excel(xfile,index=False)
      print(df)
code_tokens: def compute_correlation ( ) : w = 100 m = 22 N = 5000 ds = np . full ( ( 7 , N ) , - 1.7 ) r = np . full ( ( 7 , 7 ) , - 10.8 ) mfile = "raw-execution-data/ecolab-knl-2018-10-19/alloc_prbs-" + str ( w ) + "_cores-" + str ( m ) tmp = pd . read_csv ( mfile + "/dataset_ph1.csv" ) tmp1 = tmp [ tmp [ 't2' ] > 0 ] tmp1 [ 'sum' ] = tmp1 . apply ( lambda row : ( row . t1 + row . t2 + row . t3 ) / 1000.0 , axis = 1 ) tmp2 = tmp1 [ 'sum' ] . values ph1s1 = [ tmp2 [ idx ] for idx , val in enumerate ( tmp2 ) if ( idx // 16 ) % 2 == 0 ] ds [ 0 , : ] = ptsl . inv_transform_sampling_dataset ( ph1s1 , N ) ph1s2 = [ tmp2 [ idx ] for idx , val in enumerate ( tmp2 ) if ( idx // 16 ) % 2 == 1 ] ds [ 3 , : ] = ptsl . inv_transform_sampling_dataset ( ph1s2 , N ) tmp = pd . read_csv ( mfile + "/dataset_ph2.csv" ) tmp1 = tmp [ tmp [ 't2' ] > 0 ] tmp1 [ 'sum' ] = tmp1 . apply ( lambda row : ( row . t1 + row . t2 + row . t3 ) / 1000.0 , axis = 1 ) tmp2 = tmp1 [ 'sum' ] . values ph2s1 = [ tmp2 [ idx ] for idx , val in enumerate ( tmp2 ) if ( idx // 16 ) % 2 == 0 ] ds [ 1 , : ] = ptsl . inv_transform_sampling_dataset ( ph2s1 , N ) ph2s2 = [ tmp2 [ idx ] for idx , val in enumerate ( tmp2 ) if ( idx // 16 ) % 2 == 1 ] ds [ 4 , : ] = ptsl . inv_transform_sampling_dataset ( ph2s2 , N ) tmp = pd . read_csv ( mfile + "/dataset_ph3.csv" ) tmp1 = tmp [ tmp [ 't2' ] > 0 ] tmp1 [ 'sum' ] = tmp1 . apply ( lambda row : ( row . t1 + row . t2 + row . t3 ) / 1000.0 , axis = 1 ) tmp2 = tmp1 [ 'sum' ] . values ph3s1 = [ tmp2 [ idx ] for idx , val in enumerate ( tmp2 ) if ( idx // 16 ) % 2 == 0 ] ds [ 2 , : ] = ptsl . inv_transform_sampling_dataset ( ph3s1 , N ) ph3s2 = [ tmp2 [ idx ] for idx , val in enumerate ( tmp2 ) if ( idx // 16 ) % 2 == 1 ] ds [ 5 , : ] = ptsl . inv_transform_sampling_dataset ( ph3s2 , N ) tmp = pd . read_csv ( mfile + "/dataset_ph4.csv" ) tmp1 = tmp [ tmp [ 't2' ] > 0 ] tmp1 [ 'sum' ] = tmp1 . apply ( lambda row : ( row . t1 + row . t2 + row . t3 ) / 1000.0 , axis = 1 ) ph4 = tmp1 [ 'sum' ] . values ds [ 6 , : ] = ptsl . inv_transform_sampling_dataset ( ph4 , N ) for i in range ( 0 , 7 ) : for j in range ( 0 , 7 ) : r [ i , j ] , _ = stats . pearsonr ( ds [ i , : ] , ds [ j , : ] ) df = pd . DataFrame ( r ) xfile = "r-w" + str ( w ) + "-m" + str ( m ) + ".xlsx" df . to_excel ( xfile , index = False ) print ( df )
short_docstring: Compute the correlation coefficient
  amongst different phases
short_docstring_tokens: Compute the correlation coefficient amongst different phases
comment: """ 
          Compute the correlation coefficient
          amongst different phases 
      """$SEP$# Collect ph1s1 dataset$SEP$# Compute the pearson correaltion coefficient