本文整理汇总了Python中A.build_s方法的典型用法代码示例。如果您正苦于以下问题:Python A.build_s方法的具体用法?Python A.build_s怎么用?Python A.build_s使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类A
的用法示例。
在下文中一共展示了A.build_s方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: import A [as 别名]
# 或者: from A import build_s [as 别名]
def run(train, test, language, answer):
results = {}
#calc_high_frequency_words(train)
print 'Calling A'
s = A.build_s(train)
for lexelt in train:
train_features, y_train = extract_features(train[lexelt],language,lexelt,s[lexelt])
test_features, _ = extract_features(test[lexelt],language,lexelt,s[lexelt])
X_train, X_test = vectorize(train_features,test_features)
X_train_new, X_test_new = feature_selection(X_train, X_test,y_train,language)
results[lexelt] = classify(X_train_new, X_test_new,y_train)
A.print_results(results, answer)
print 'ended'