print 'Generated Results Array' for i in xrange(E.R.shape[0]): # for each alg version for j in xrange(E.R.shape[1]): # for each parameter set for the alg version for k in xrange(E.R.shape[2]): # for each data set parameter set anomalies_list = [] gt_list = [] for ic in xrange(D.shape[0]): # for each initial condition # Fetch alg F = E.F_dict[E.R[i,j,k]['key']] # Fetch data data = np.load(path + '/' + D[ic,k]['file']) #data = data.reshape(E.R[i,j,k]['params']['dat']['T'], E.R[i,j,k]['params']['dat']['N']) data = zscore_win(data, F.p['z_win']) '''Initialise''' z_iter = iter(data) numStreams = data.shape[1] F.re_init(numStreams) '''Begin Frahst''' # Main iterative loop. for zt in z_iter: zt = zt.reshape(zt.shape[0],1) # Convert to a column Vector if np.any(F.st['anomaly']): F.st['anomaly'][:] = False # reset anomaly var '''Frahst Version '''
for i in xrange(E.R.shape[0]): # for each alg version for j in xrange( E.R.shape[1]): # for each parameter set for the alg version for k in xrange(E.R.shape[2]): # for each data set parameter set anomalies_list = [] gt_list = [] for ic in xrange(D.shape[0]): # for each initial condition # Fetch alg F = E.F_dict[E.R[i, j, k]['key']] # Fetch data data = np.load(path + '/' + D[ic, k]['file']) #data = data.reshape(E.R[i,j,k]['params']['dat']['T'], E.R[i,j,k]['params']['dat']['N']) data = zscore_win(data, F.p['z_win']) '''Initialise''' z_iter = iter(data) numStreams = data.shape[1] F.re_init(numStreams) '''Begin Frahst''' # Main iterative loop. for zt in z_iter: zt = zt.reshape(zt.shape[0], 1) # Convert to a column Vector if np.any(F.st['anomaly']): F.st['anomaly'][:] = False # reset anomaly var '''Frahst Version ''' F.run(zt) # Calculate reconstructed data if needed
step=gen_a_step, step_n_back=gen_a_step_n_back, trend=gen_a_periodic_shift) '''Setup Data Structure''' time_results = np.array([0.0] * dat_change_count) for k, n in enumerate(dat_changes['N']): # set time sample buffer time_sample_list = np.array([0.0] * initial_conditions) for i in range(initial_conditions): '''Generate Data Set''' a['N'] = n D = gen_funcs[anomaly_type](**a) data = D['data'] ''' Mean Centering ''' data = zscore_win(data, 100) #data = zscore(data) data = np.nan_to_num(data) z_iter = iter(data) numStreams = data.shape[1] # Initialise Algorithm F = FRAHST('F-7.A-recS.R-static.S-none', p, numStreams) # Start time Profiling start = time.time() '''Begin Frahst''' # Main iterative loop. for zt in z_iter: zt = zt.reshape(zt.shape[0], 1) # Convert to a column Vector
trend = gen_a_periodic_shift) '''Setup Data Structure''' time_results = np.array([0.0]* dat_change_count) for k,n in enumerate(dat_changes['N']): # set time sample buffer time_sample_list = np.array([0.0]*initial_conditions) for i in range(initial_conditions): '''Generate Data Set''' a['N'] = n D = gen_funcs[anomaly_type](**a) data = D['data'] ''' Mean Centering ''' data = zscore_win(data, 100) #data = zscore(data) data = np.nan_to_num(data) z_iter = iter(data) numStreams = data.shape[1] # Initialise Algorithm F = FRAHST('F-7.A-recS.R-static.S-none', p, numStreams) # Start time Profiling start = time.time() '''Begin Frahst''' # Main iterative loop. for zt in z_iter: