generate_labels
grb_trigger.dataset.generate_labels(n_bins, events, background_bins_number=100, foreground_bins_number=10)Produces the 1D target array matching the exact rows returned by features.feature_extraction_loop().
Parameters
n_binsint-
signal length in bin number.
eventslist of dict-
Each dict has the keys
"signal"((low, high)arrays),"start_bin"(int, > 0),"type"(str, e.g."grb") and optionally"is_grb"(0 or 1). background_bins_numberint, default 100-
Number of bins in the background window.
foreground_bins_numberint, default 10-
Number of bins in the foreground window.
Returns
ynumpy.ndarray-
Target column: true if more than half of the window values are is_grb=1
Notes
Returned array has shape (n,) with
n = n_bins - background_bins_number - foreground_bins_number + 1.