本文整理汇总了Python中tools.Tools.getDictArray方法的典型用法代码示例。如果您正苦于以下问题:Python Tools.getDictArray方法的具体用法?Python Tools.getDictArray怎么用?Python Tools.getDictArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tools.Tools
的用法示例。
在下文中一共展示了Tools.getDictArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: failingPeaks
# 需要导入模块: from tools import Tools [as 别名]
# 或者: from tools.Tools import getDictArray [as 别名]
def failingPeaks(path):
from DataLoader import getData
data = getData(path, None, True)
samples = tls.getDictArray(data.Features)
people = dict()
peaks = dict()
i = 0
for sample in samples:
for f in sample.keys():
countedPeaks = []
if sample[f] is None:
peak = f.split('.')[1]
countedPeaks += peak
if `i` in people:
people[`i`] += 1
else:
people[`i`] = 1
if f in peaks:
peaks[peak] += 1
else:
peaks[peak] = 1
i += 1
示例2: classifyData
# 需要导入模块: from tools import Tools [as 别名]
# 或者: from tools.Tools import getDictArray [as 别名]
def classifyData(data, classifyTrained, classifySurface,
classifierClass, featuresSelect,scaling=False):
features = tls.getDictArray(data.Features)
[samples, featureNames,imputer,scaler] = extractData(features,scaling=scaling)
[classifications, classNames] = selectClassifications(data,
classifyTrained, classifySurface)
if (not 'all' in featuresSelect):
[samples, featureNames] = selectFeatures(samples,
classifications, featureNames,
classifierClass, featuresSelect)
else:
print('Using all features')
classifier = classifierClass(samples, featureNames,
classifications, classNames)
classifier.setTransformOperators(imputer,scaler)
return classifier