-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add option to select which model to use for counterfactual computation #2255
Conversation
@jameswex please review. |
@@ -2868,6 +2898,10 @@ <h2>Show similarity to selected datapoint</h2> | |||
return stats && Object.keys(stats).length > 0; | |||
}, | |||
|
|||
shouldHideCounterfactualModelSelector_: function(modelNames) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about being dependent on "numModels" instead? Then just need to check if that num != 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to make sure that parsedModelNames is populated before creating the window element, in case we end up in a state where numModels is set but parsedModelNames is still being processed. Right now it seems like parsedModelNames is updated before numModels, so again it may cause some inconsistencies (e.g. numModels=1 but parsedModelNames,length=2).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only one comment
// TODO (tolgab) Update for model comparison | ||
nearestCounterfactualModelChanged_: function() { | ||
if (this.showNearestCounterfactual) { | ||
this.findClosestCounterfactual_(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a bit of repetition with nearestCounterfactualDistChanged_
. Would it make sense to just use an observer and do
observers: [
...,
'maybeFindClosestCounterFactual_(showNearestCounterfactual, nearestCounterfactualModel, nearestCounterfactualDist)'
],
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, done!
// Choose which model is used for counterfactual computation | ||
nearestCounterfactualModel: { | ||
type: Number, | ||
value: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this number referring to an id of a model or an index? Perhaps a change to the prop name to better depict its nature might be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
Motivation for features / changes
This PR adds the ability to choose which model to use for for counterfactual example computation (Previously, it was computed with respect to first model).
Technical description of changes
Added a drop-down menu to choose model name in counterfactual settings row. This panel is hidden when there is only one loaded model.
Screenshots of UI changes
Detailed steps to verify changes work correctly (as executed by you)
I ran all demos locally and verified that counterfactuals are computed correctly for the chosen model.
Alternate designs / implementations considered