Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

complement_label - category 0 is always 1 #16

Open
michaelgorkow opened this issue Oct 20, 2018 · 1 comment
Open

complement_label - category 0 is always 1 #16

michaelgorkow opened this issue Oct 20, 2018 · 1 comment

Comments

@michaelgorkow
Copy link

Hi shuyo,

could you explain why you are always setting category 0 to 1? (vec[0]= 1.0)

 def complement_label(self, label):
        if not label: return numpy.ones(len(self.labelmap))
        vec = numpy.zeros(len(self.labelmap))
        vec[0] = 1.0
        for x in label: vec[self.labelmap[x]] = 1.0
        return vec

Thank you and best regards!

@datduong
Copy link

I think he has category "zero" as the "common" label. Notice this line here in the code
labelset.insert(0, "common"). Also, do you know how we can use the already trained model to make prediction for a new unseen document ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants