-
Notifications
You must be signed in to change notification settings - Fork 78
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
Extra srcdep parameters and limit the offset of gamma MC for training #1077
Conversation
…rectness) for source-dep analysis and limit the offset of gamma MC for the RF training
@@ -478,10 +478,13 @@ def build_models(filegammas, fileprotons, | |||
# Apply the temporary disp norm regressor and sign classifier to the test set | |||
disp_norm = tmp_reg_disp_norm.predict(test[config['disp_regression_features']]) | |||
disp_sign = tmp_cls_disp_sign.predict(test[config['disp_classification_features']]) | |||
disp_sign_proba = tmp_cls_disp_sign.predict_proba(test[config['disp_classification_features']]) |
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.
There is no need to call predict and predict proba, that's wasteful. Since we now want the proba, you should change the disp_sign
calculation to use the proba to not evaluate the random forest twice:
col = list(tmp_cls_disp_sign.classes_).index(1)
disp_sign = np.where(disp_sign_proba[:, col] > 0.5, 1, -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.
Thanks for the comment! Actually, I just copy & paste the codes of gammaness computation, so this part can also be updated to reduce computation time
https://github.com/cta-observatory/cta-lstchain/blob/master/lstchain/reco/dl1_to_dl2.py#L652-L653
CI failed since only a single event survives after off-axis cut (src_r < 1 degree) ... |
I think it was @maxnoe the one creating those datasets, right? Would it be possible to create one including more inner events now that we have seen an improvement in the performance of src-dependent analysis? |
so @maxnoe would it be possible to get a different test dataset with more off-axis events or shall we change the tests for them to pass after these conditions are applied? |
…to zeros) to keep events after src_r cut)
No sure what simulations you are talking about, but I can't remember creating any. If you need a new small test file with specific settings, you should probably ask the simulation team to create it, like I did here: |
ah I see Max's comment now, but now I prepared fake DL1 MC gamma file (like fake proton MC) by changing |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1077 +/- ##
==========================================
+ Coverage 74.02% 74.12% +0.10%
==========================================
Files 123 123
Lines 11869 11915 +46
==========================================
+ Hits 8786 8832 +46
Misses 3083 3083
☔ View full report in Codecov by Sentry. |
This PR implements extra two parameters for source-dep analysis defined in the following slides.
Any comments are welcome, especially the naming of the parameters...!
https://indico.cta-observatory.org/event/4631/contributions/38096/attachments/23113/33203/20230213_srcdep_update.pdf
In addition, this PR changes the default value of `src_r_cut of MC gamma for the RF training.