本文整理汇总了Python中feature.Feature.process方法的典型用法代码示例。如果您正苦于以下问题:Python Feature.process方法的具体用法?Python Feature.process怎么用?Python Feature.process使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feature.Feature
的用法示例。
在下文中一共展示了Feature.process方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: predict
# 需要导入模块: from feature import Feature [as 别名]
# 或者: from feature.Feature import process [as 别名]
def predict(test_dir, xpath):
feature = Feature(test_dir + '/oracle.png', test_dir + '/test.html', xpath)
feature.process()
vecter = feature.output_binary()
print vecter
score = rank_bayes(vecter)
sorted_score = sorted(score.iteritems(), key=operator.itemgetter(1))
return sorted_score
示例2: open
# 需要导入模块: from feature import Feature [as 别名]
# 或者: from feature.Feature import process [as 别名]
import os
import timeit
from feature import Feature
if __name__ == "__main__":
home_dir = "data3"
foutput = open("train.model", "w")
with open(home_dir + "/description.txt") as f:
t = 0
for line in f:
t += 1
split = line.strip().split("\t")
start = timeit.default_timer()
feature = Feature(
home_dir + "/" + split[8] + "/oracle.png", home_dir + "/" + split[8] + "/test.html", split[7]
)
feature.process()
foutput.write(split[2])
for item in feature.output().values():
foutput.write("\t" + str(int(item == True)))
foutput.write("\n")
foutput.flush()
stop = timeit.default_timer()
print stop - start
break