Created
December 15, 2022 20:39
-
-
Save kmdupr33/26dc76f282d16b36aa8bf917c8138e92 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def show_doubt_if_modeling(): | |
global _o_predicates | |
if 'model' in dc_code and 'X' in dc_code and 'y' in dc_code: | |
from doubtlab.ensemble import DoubtEnsemble | |
from doubtlab.reason import ProbaReason, WrongPredictionReason | |
# Next we can add reasons for doubt. In this case we're saying | |
# that examples deserve another look if the associated proba values | |
# are low or if the model output doesn't match the associated label. | |
reasons = { | |
'proba': ProbaReason(model=model), | |
'wrong_pred': WrongPredictionReason(model=model) | |
} | |
# Pass these reasons to a doubtlab instance. | |
doubt = DoubtEnsemble(**reasons) | |
_o_predicates = doubt.get_predicates(X, y) | |
return _o_predicates | |
show_doubt_if_modeling() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment