Skip to content
New issue

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

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

Already on GitHub? # to your account

Trouble interpreting model results #45

Open
bricheet opened this issue Feb 3, 2020 · 0 comments
Open

Trouble interpreting model results #45

bricheet opened this issue Feb 3, 2020 · 0 comments

Comments

@bricheet
Copy link

bricheet commented Feb 3, 2020

I trained an sklearn-crfsuite model, loaded it, and did the following over a list of feature dictionaries, f:

In [30]: model.predict_single(f)
Out[30]: ['O', 'O', 'O', 'O', 'O', 'O']

In [31]: model.predict_marginals_single(f)
Out[31]:
[{'O': 0.1745261746219197,
  'B': 0.5264068514451985,
  'I': 0.2339401797845289,
  'L': 0.06512679414835308},
 {'O': 0.24824191035888962,
  'B': 0.018725409873972757,
  'I': 0.7004970974996407,
  'L': 0.032535582267497073},
 {'O': 0.38726418238870425,
  'B': 0.023123110925499846,
  'I': 0.5360999708168728,
  'L': 0.05351273586892334},
 {'O': 0.6589927039399383,
  'B': 0.016655136632099794,
  'I': 0.29598932815952433,
  'L': 0.02836283126843751},
 {'O': 0.7196014086563483,
  'B': 0.01650014534988327,
  'I': 0.21009579163045422,
  'L': 0.05380265436331424},
 {'O': 0.8092866077540308,
  'B': 0.02555488041746064,
  'I': 0.13238860165571603,
  'L': 0.032769910172792384}]

As you can see, for the first 3 items, the labels with the highest probabilities are B, I, and I. However, the output of predict_single only consists of O's. Why would this be the case?

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

No branches or pull requests

1 participant