MCPcopy Create free account
hub / github.com/Open-Quant/openquant / get_bins

Function get_bins

crates/openquant/src/labeling.rs:232–240  ·  view source on GitHub ↗

Backward-compatible label API.

(
    events: &[(NaiveDateTime, Event)],
    close: &[(NaiveDateTime, f64)],
)

Source from the content-addressed store, hash-verified

230
231/// Backward-compatible label API.
232pub fn get_bins(
233 events: &[(NaiveDateTime, Event)],
234 close: &[(NaiveDateTime, f64)],
235) -> Vec<(NaiveDateTime, f64, f64, i8, Option<f64>)> {
236 triple_barrier_labels(events, close)
237 .into_iter()
238 .map(|row| (row.timestamp, row.ret, row.trgt, row.label, row.side))
239 .collect()
240}
241
242/// Drop labels whose frequency is below `min_pct`.
243pub fn drop_labels(

Callers 4

test_pt_sl_levelsFunction · 0.85
test_drop_labelsFunction · 0.85
labeling_get_binsFunction · 0.85

Calls 1

triple_barrier_labelsFunction · 0.85

Tested by 3

test_pt_sl_levelsFunction · 0.68
test_drop_labelsFunction · 0.68