Skip to content

Commit

Permalink
get col of gamma mc_type from classifier
Browse files Browse the repository at this point in the history
  • Loading branch information
SeiyaNozaki committed Feb 27, 2024
1 parent 4dbd296 commit 24ecab8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lstchain/reco/dl1_to_dl2.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,10 +728,11 @@ def apply_models(dl1,
"the predicted probabilty to assign as gammaness is unclear."
"Please check training data")

# gammaness is the prediction probability for the first class (0)
dl2['gammaness'] = probs[:, 0]
col = list(classifier.classes_).index(0)
dl2['reco_type'] = np.where(probs[:, col] > 0.5, 0, 101)
# gammaness is the prediction probability for the class 0 (proton: class 101)
mc_type_gamma, mc_type_proton = 0, 101
col = list(classifier.classes_).index(mc_type_gamma)
dl2['gammaness'] = probs[:, col]
dl2['reco_type'] = np.where(probs[:, col] > 0.5, mc_type_gamma, mc_type_proton)
del classifier

return dl2
Expand Down

0 comments on commit 24ecab8

Please sign in to comment.