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

what is ops_thresh and how do you arrive at the hard coded value for each model? #151

Open
fanhui3 opened this issue Apr 11, 2024 · 1 comment

Comments

@fanhui3
Copy link

fanhui3 commented Apr 11, 2024

I understand the predicted values before applying op_norm returns probabilities in very low decimal points, sometimes as low as 0.00XXX. The ops_threshs is there to normalise the value between 0 and 1. What is the approach used to attained the selected ops_thresh?

I am currently doing finetuning on the model. Thank you.

p.s. Thank you for releasing such useful work to the world, by the way.

@ieee8023
Copy link
Member

The ops_threshs is there to normalise the value between 0 and 1.

No, the ops_thresh is to normalize the values so that 0.5 is the decision boundary. So values above 0.5 can be considered positive and less than 0.5 considered negative. See Section 2.5 Model Calibration here: https://arxiv.org/pdf/2111.00595.pdf

Also check out Section 4 Transfer Learning Example where "model.op_threshs = None" to remove this calibration so it doesn't get in the way of fine tuning.

You can see how the thresholds are computed here:

all_outputs = 1.0/(1.0 + np.exp(-results[2][i]))
fpr, tpr, thres = sklearn.metrics.roc_curve(results[3][i], all_outputs)
pente = tpr - fpr
opt_thres = thres[np.argmax(pente)]

p.s. Thank you for releasing such useful work to the world, by the way.

No problem!

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