本文整理汇总了Python中feature_extractor.FeatureExtractor.get_minmax_features方法的典型用法代码示例。如果您正苦于以下问题:Python FeatureExtractor.get_minmax_features方法的具体用法?Python FeatureExtractor.get_minmax_features怎么用?Python FeatureExtractor.get_minmax_features使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feature_extractor.FeatureExtractor
的用法示例。
在下文中一共展示了FeatureExtractor.get_minmax_features方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: timedelta
# 需要导入模块: from feature_extractor import FeatureExtractor [as 别名]
# 或者: from feature_extractor.FeatureExtractor import get_minmax_features [as 别名]
#.........这里部分代码省略.........
procData = rawData.resample('2Min', how='mean')
else:
procData = None
return procData
def receive_a_sensor(self, zone, actuType, beginTime, endTime, normType):
print zone, actuType
uuid = self.get_actuator_uuid(zone, actuType)
rawData = self.bdm.get_sensor_ts(uuid, 'PresentValue', beginTime, endTime)
if actuType!=self.actuNames.damperCommand:
rawData = self.remove_negativeone(rawData)
procData = self.normalize_data(rawData, beginTime, endTime, normType)
return procData
def receive_entire_sensors_notstore(self, beginTime, endTime, normType, exceptZoneList=[]):
#TODO: Should be parallelized here
dataDict = dict()
for zone in self.zonelist:
if not zone in exceptZoneList:
dataDict[zone] = self.receive_zone_sensors(zone, beginTime, endTime, normType)
return dataDict
def receive_entire_sensors(self, beginTime, endTime, filename, normType, exceptZoneList=[]):
# filename='data/'+beginTime.isoformat()[0:-7].replace(':','_') + '.pkl'
dataDict = self.receive_entire_sensors_notstore(beginTime, endTime, normType, exceptZoneList=exceptZoneList)
with open(filename, 'wb') as fp:
pickle.dump(dataDict, fp)
# json.dump(dataDict,fp)
def clustering(self, inputData, dataDict):
fftFeat = self.feater.get_fft_features(inputData, dataDict)
minmaxFeat = self.feater.get_minmax_features(dataDict)
dtwFeat = self.feater.get_dtw_features(inputData, dataDict)
freqFeat = self.feater.get_freq_features(inputData, dataDict)
featDict = dict()
for zone in self.zonelist:
featList = list()
featList.append(fftFeat[zone])
featList.append(minmaxFeat[zone])
featList.append(dtwFeat[zone])
#featList.append(freqFeat[zone])
featDict[zone] = featList
print featDict['RM-4132']
return self.clust.cluster_kmeans(featDict)
def remove_negativeone(self, data):
if -1 in data.values:
indices = np.where(data==-1)
for idx in indices:
data[idx] = data[idx-1]
return data
def receive_zone_sensors(self, zone, beginTime, endTime, normType):
zoneDict = dict()
for actuType in self.actuNames.nameList+self.sensorNames.nameList:
if actuType=='Actual Supply Flow':
pass
try:
uuid = self.get_actuator_uuid(zone, actuType)
except QRError:
continue
# if actuType == self.actuNames.commonSetpoint:
# wcad = self.receive_a_sensor(zone, 'Warm Cool Adjust', beginTime, endTime, normType)
# data = self.receive_a_sensor(zone, actuType, beginTime, endTime, normType)