本文整理汇总了Python中SonicScrewdriver.appendtodict方法的典型用法代码示例。如果您正苦于以下问题:Python SonicScrewdriver.appendtodict方法的具体用法?Python SonicScrewdriver.appendtodict怎么用?Python SonicScrewdriver.appendtodict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SonicScrewdriver
的用法示例。
在下文中一共展示了SonicScrewdriver.appendtodict方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: import SonicScrewdriver [as 别名]
# 或者: from SonicScrewdriver import appendtodict [as 别名]
poetryFNs.append(poetryFN)
fictionTPs.append(fictionTP)
fictionFPs.append(fictionFP)
fictionTNs.append(fictionTN)
fictionFNs.append(fictionFN)
dramaTPs.append(dramaTP)
dramaFPs.append(dramaFP)
dramaTNs.append(dramaTN)
dramaFNs.append(dramaFN)
for genre in genrestocheck:
precision = predicted.genreaccuracy(genre, correctgenres)
if precision <= 1:
utils.appendtodict(genre, predicted.genrefeatures(genre), genrefeatures)
utils.appendtodict(genre, precision, genreprecisions)
utils.appendtodict(genre, True, modeledvols)
else:
utils.appendtodict(genre, False, modeledvols)
# Precision > 1 is a signal that we actually have no true or false
# positives in the volume for this genre. In that circumstance, we're
# not going to use the volume to train a metamodel for the genre, because
# it won't usefully guide what we want to guide -- assessment of the
# accuracy of our positive predictions for this genre.
#
# So we don't append the genre features or precision to the arrays
# that are going to be used to create a genre-specific metamodel.
#
# On the other hand, there could be false negatives in the volume, and
# we want to acknowledge that when calculating overall recall.