def try_stuff(sa, label): for i in xrange(sa.count): ag= create_all_matching_keywords_article_group_from_sa(sa, 1000, 5, i) if ag.count_sources > value: keyword_list= "" for word in list(sa.get_keywords(i)): keyword_list+= " " + word get_results(ag, label+ ", keywords= " + keyword_list + ", article number\ =" + str(i))
def get_results(ag, label): accuracy, false_positives, false_negatives, c_value= find_best(ag, c_values,\ thresholds) print "" #print stuff here print "Permutation: " + label print "Accuracy: " + str(accuracy) print "False positives: " + str(false_positives) print "False negatives: " + str(false_negatives) print "c_value: " + str(c_value) print "" sa= SourceArticles() for i in xrange(sa.count): ag= create_all_matching_keywords_article_group_from_sa(sa, 1000, 200, i) if ag.count_sources > value: keyword_list= "" for word in list(sa.get_keywords(i)): keyword_list+= " " + word get_results(ag, "No specials, keywords= " + keyword_list + ", article number\ =" + str(i)) #repeat many times... sa= SourceArticles(omit_stopwords=True) for i in xrange(sa.count): ag= create_all_matching_keywords_article_group_from_sa(sa, 1000, 200, i) if ag.count_sources > value: keyword_list= ""