common/processing.py
def predict(self, ds, Vx, dt_start, dt_end):
		"""
		Returns MSE values of interval of 15 minutes 

		:param ds:			dataset of 5 days for testing 
		:param Vx:			Trained Eigen Vectors 
		:param ds_start:	Start date in dataset
		:param ds_end: 		Finish date in dateset
		:return output:		Dictionary with 2 <value/pair> of MSE/starting date of the interval  
		"""
		output = {}
		conv = (1*2.5)*2**-15
		for d_inx in tqdm([date for date in time_slot_gen(dt_start,dt_end, 4)]): 

			init = ds['ts']/1000 > d_inx
			last = ds['ts']/1000 < d_inx + (60*15) 
			section = ds['z'][init & last]
			if section.shape[0]>0: 
				filtered_data = energy_filter(section*conv, self.dim, self.energy_threshold)
				if filtered_data.shape[1]>0:
					filtered_data = sklearn.preprocessing.scale(filtered_data, axis=0, with_mean=True, with_std=True, copy=True)
					if self.domain == 'time':
						mse_temp = self.predict_time_(filtered_data, Vx)
					elif self.domain == 'frequency': 
						mse_temp = self.predict_freq_(filtered_data, Vx, axis_=0)
					elif self.domain == 'wavelet': 
						mse_temp = self.predict_dwt_(filtered_data, Vx )
					if output == {}:
						output['mse'] = mse_temp
						output['date'] = d_inx
					else: 
						output['mse'] = np.append(output['mse'], mse_temp)
						output['date'] = np.append(output['date'], d_inx)
		return output

		Returns MSE values of interval of 15 minutes 

		:param ds:			dataset of 5 days for testing 
		:param Vx:			Trained Eigen Vectors 
		:param ds_start:	Start date in dataset
		:param ds_end: 		Finish date in dateset
		:return output:		Dictionary with 2 <value/pair> of MSE/starting date of the interval  
		
Returns MSE values of interval of 15 minutes
Returns MSE values of interval of 15 minutes
def predict(self, ds, Vx, dt_start, dt_end):
		output = {}
		conv = (1*2.5)*2**-15
		for d_inx in tqdm([date for date in time_slot_gen(dt_start,dt_end, 4)]): 
			init = ds['ts']/1000 > d_inx
			last = ds['ts']/1000 < d_inx + (60*15) 
			section = ds['z'][init & last]
			if section.shape[0]>0: 
				filtered_data = energy_filter(section*conv, self.dim, self.energy_threshold)
				if filtered_data.shape[1]>0:
					filtered_data = sklearn.preprocessing.scale(filtered_data, axis=0, with_mean=True, with_std=True, copy=True)
					if self.domain == 'time':
						mse_temp = self.predict_time_(filtered_data, Vx)
					elif self.domain == 'frequency': 
						mse_temp = self.predict_freq_(filtered_data, Vx, axis_=0)
					elif self.domain == 'wavelet': 
						mse_temp = self.predict_dwt_(filtered_data, Vx )
					if output == {}:
						output['mse'] = mse_temp
						output['date'] = d_inx
					else: 
						output['mse'] = np.append(output['mse'], mse_temp)
						output['date'] = np.append(output['date'], d_inx)
		return output
def predict ( self , ds , Vx , dt_start , dt_end ) : output = { } conv = ( 1 * 2.5 ) * 2 ** - 15 for d_inx in tqdm ( [ date for date in time_slot_gen ( dt_start , dt_end , 4 ) ] ) : init = ds [ 'ts' ] / 1000 > d_inx last = ds [ 'ts' ] / 1000 < d_inx + ( 60 * 15 ) section = ds [ 'z' ] [ init & last ] if section . shape [ 0 ] > 0 : filtered_data = energy_filter ( section * conv , self . dim , self . energy_threshold ) if filtered_data . shape [ 1 ] > 0 : filtered_data = sklearn . preprocessing . scale ( filtered_data , axis = 0 , with_mean = True , with_std = True , copy = True ) if self . domain == 'time' : mse_temp = self . predict_time_ ( filtered_data , Vx ) elif self . domain == 'frequency' : mse_temp = self . predict_freq_ ( filtered_data , Vx , axis_ = 0 ) elif self . domain == 'wavelet' : mse_temp = self . predict_dwt_ ( filtered_data , Vx ) if output == { } : output [ 'mse' ] = mse_temp output [ 'date' ] = d_inx else : output [ 'mse' ] = np . append ( output [ 'mse' ] , mse_temp ) output [ 'date' ] = np . append ( output [ 'date' ] , d_inx ) return output
Returns MSE values of interval of 15 minutes
Returns MSE values of interval of 15 minutes
"""
		Returns MSE values of interval of 15 minutes 

		:param ds:			dataset of 5 days for testing 
		:param Vx:			Trained Eigen Vectors 
		:param ds_start:	Start date in dataset
		:param ds_end: 		Finish date in dateset
		:return output:		Dictionary with 2 <value/pair> of MSE/starting date of the interval  
		"""
Dictionary with 2  of MSE/starting date of the interval
Dictionary with 2 of MSE / starting date of the interval
output
self
ds
dataset of 5 days for testing
dataset of 5 days for testing
Vx
Trained Eigen Vectors
Trained Eigen Vectors
dt_start
dt_end
ds_start
Start date in dataset
Start date in dataset
ds_end
Finish date in dateset
Finish date in dateset