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

Access scores as attribute preds.data.instance_score #75

Closed
mishinma opened this issue Dec 13, 2019 · 2 comments
Closed

Access scores as attribute preds.data.instance_score #75

mishinma opened this issue Dec 13, 2019 · 2 comments

Comments

@mishinma
Copy link
Contributor

It would be nice to be able to access prediction scores as preds.data.instance_score instead of preds["data"]["instance_score"]. Could be accomplished with addict https://github.com/mewwts/addict (also Bunch could be replaced with addict if it doesn't serve other purpose). This is just a personal opinion though, feel free to ignore. :)

@jklaise
Copy link
Member

jklaise commented Dec 13, 2019

I think in the future we will move to custom objects rather than using Python dictionaries (which is the plan for Alibi), in which case one would have 2-level attribute access (e.g. both preds.data returning a dict and preds.instance_score returning the scores). I've thought about a more general solution using e.g. Bunch as you suggest, but the main downside would be that numerical indices can't be accessed as attributes which might make the whole thing more confusing.

@mishinma
Copy link
Contributor Author

@jklaise makes sense. I think it's done that way in FAIR's Detectron too. I will close this

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