Skip to content
Permalink
master
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
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",
"unigrams, presence, +POS",
"bigrams, presence, +POS"
]
labels2 = [
"unigrams, frequency",
"unigrams, frequency, +Position",
"unigrams, presence",
"unigrams, presence, +Position",
"bigrams, frequency",
"bigrams, frequency, +Position",
"bigrams, presence",
"bigrams, presence, +Position",
"delta_tfidf",
"unigrams, presence, +POS",
"bigrams, presence, +POS"
]
bottoms = numpy.arange(len(labels))
widths = [0.826002649356, 0.784479089868, 0.842490694287, 0.821997146847, 0.807497617378, 0.777000053946, 0.820491149832, 0.795509581438, 0.981992471513, 0.836989684295, 0.818997140853]
widths2 = [0.824624634419, 0.808376475678, 0.832750728912, 0.815374570779, 0.797876474366, 0.771876439875, 0.799001849413, 0.768376127015, 0.929999178955, 0.813999695576, 0.792252879562]
height = 0.3
pyplot.barh(bottoms, widths, height, color="#FF0000")
pyplot.barh(bottoms-height, widths2, height, color="#00FF00")
pyplot.legend(["Movies", "Amazon"], loc=4) # bottom right
pyplot.yticks(bottoms, labels)
pyplot.xlim(0.5, 1.0)
#pyplot.ylim(tops[0]-2*height, bottoms[-1]+3*height)
pyplot.show()
"""
# TODO: Use POS tags on Amazon dataset.
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
gram_length: 1, use_presence: True, use_amazon: False, use_pos_tags: True, use_adj_only: False, use_position:False 0.836989684295
gram_length: 1, use_presence: True, use_amazon: False, use_pos_tags: True, use_adj_only: False, use_position:True 0.814993136849
gram_length: 1, use_presence: True, use_amazon: False, use_pos_tags: True, use_adj_only: True, use_position: False 0.769011526497
gram_length: 1, use_presence: True, use_amazon: False, use_pos_tags: True, use_adj_only: True, use_position: True 0.749997002991
gram_length: 2, use_presence: False, use_amazon: False, use_pos_tags: True, use_adj_only: False, use_position: False 0.800000599402
gram_length: 2, use_presence: False, use_amazon: False, use_pos_tags: True, use_adj_only: False, use_position: True 0.762980045914
gram_length: 2, use_presence: False, use_amazon: False, use_pos_tags: True, use_adj_only: True, use_position:False 0.707506908106
gram_length: 2, use_presence: False, use_amazon: False, use_pos_tags: True, use_adj_only: True, use_position:True 0.669494344644
gram_length: 2, use_presence: True, use_amazon: False, use_pos_tags: True, use_adj_only: False, use_position:False 0.818997140853
gram_length: 2, use_presence: True, use_amazon: False, use_pos_tags: True, use_adj_only: False, use_position:True 0.78900607194
gram_length: 2, use_presence: True, use_amazon: False, use_pos_tags: True, use_adj_only: True, use_position: False 0.714507921095
gram_length: 2, use_presence: True, use_amazon: False, use_pos_tags: True, use_adj_only: True, use_position: True 0.668990847135
"""