Skip to content
Permalink
cf6576fb12
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
43 lines (41 sloc) 1.71 KB
import numpy
from matplotlib import pyplot
labels = [
"unigrams, frequency",
"unigrams, frequency, +Position",
"unigrams, presence",
"unigrams, presence, +Position",
"bigrams, frequency",
"bigrams, frequency, +Position",
"bigrams, presence",
"bigrams, presence, +Position",
"delta_tfidf"
]
labels2 = [
"unigrams, frequency",
"unigrams, frequency, +Position",
"unigrams, presence",
"unigrams, presence, +Position",
"bigrams, frequency",
"bigrams, frequency, +Position",
"bigrams, presence",
"bigrams, presence, +Position",
"delta_tfidf"
]
tops = numpy.arange(len(labels))
widths = [0.826002649356, 0.784479089868, 0.842490694287, 0.821997146847, 0.807497617378, 0.777000053946, 0.820491149832, 0.795509581438, 0.981992471513]
widths2 = [0.824624634419, 0.808376475678, 0.832750728912, 0.815374570779, 0.797876474366, 0.771876439875, 0.799001849413, 0.768376127015, 0.929999178955]
height = 0.3
pyplot.barh(tops, widths, height, color="#FF0000")
pyplot.barh(tops+height, widths2, height, color="#00FF00")
pyplot.legend(["Movies", "Amazon"], loc=4) # bottom right
pyplot.yticks(tops+height, labels)
pyplot.xlim(0.5, 1.0)
pyplot.ylim(tops[0]-2*height, tops[-1]+3*height)
pyplot.show()
"""
gram_length: 1, use_presence: False, use_amazon: False, use_pos_tags: True, use_adj_only: False, use_position: False 0.822003140865
gram_length: 1, use_presence: False, use_amazon: False, use_pos_tags: True, use_adj_only: False, use_position: True 0.781988575402
gram_length: 1, use_presence: False, use_amazon: False, use_pos_tags: True, use_adj_only: True, use_position: False 0.77899606193
gram_length: 1, use_presence: False, use_amazon: False, use_pos_tags: True, use_adj_only: True, use_position: True 0.762512512513
"""