By default,Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tripolskypetr/pump-anomaly/llms.txt
Use this file to discover all available pages before exploring further.
fit() and train() write a live progress bar to process.stdout while the model trains. Training involves nested loops — slow IO-bound candle labelling followed by fast in-memory grid scoring — and the bar tracks progress across all of them. You can silence the output entirely, or replace it with any custom callback by passing onProgress in the TrainOptions.
ProgressEvent
Every tick from the training pipeline delivers a ProgressEvent to the registered callback:
Identifies the current work phase:
"label"— per-candle labelling of each candidate burst (IO-bound; one tick per symbol fetched). This is the slow phase — it callsgetCandlesover 1m data for each signal in the history."score"— scoring each configuration in the grid against the cached labels (CPU-bound; fast). One tick per grid position evaluated."nested"— outer folds of the nested cross-validation for the unbiased OOS estimate. One tick per outer fold.
How many units of work have been completed so far in this phase. Starts at
1 on the first tick; reaches total on the last.Total units of work in this phase.
stdoutProgress skips rendering when total ≤ 0 to avoid division-by-zero.Human-readable context for the current tick. During
"label" phase this is the trading symbol being fetched (e.g. "TRXUSDT"). During "score" phase it is a pipe-delimited grid key (e.g. "5|0.4|0.6|all"). During "nested" it identifies the outer fold.ProgressFn
ProgressEvent per unit of work. The callback is called from inside the fit() / train() async loop; it should return quickly and must not throw.
Pass a ProgressFn as onProgress in TrainOptions:
stdoutProgress
onProgress option is supplied to fit(). Writes a fixed-width bar to process.stdout using \r (carriage return) to overwrite the current line:
done >= total), the bar is followed by \n to advance to the next line.
Fixed-width rendering. The line is padded to 80 characters and then sliced to exactly 80 characters before writing. This prevents visual artefacts when a shorter symbol name follows a longer one on the same line — without truncation, \r would leave trailing characters from the previous tick (e.g. "SOLUSDT" after "FARTCOINUSDT" would display as "SOLUSDT NUSDT").
Three-phase output example:
stdoutProgress silently skips any event where total <= 0 to avoid division-by-zero when computing the fill ratio. This can occur on degenerate inputs (e.g. an empty history with zero labelling candidates). Your own callback should apply the same guard if it computes a percentage.silentProgress
() => {}. Suppresses all training output. Pass it when running tests, when output would interfere with structured logging, or when fit() is called in a background worker.
Custom Progress Handler
You can pass any(event: ProgressEvent) => void function as onProgress. The handler receives every tick across all three phases in the order they occur.
ProgressEvent field reference for custom handlers
| Field | Type | Notes |
|---|---|---|
phase | "label" | "score" | "nested" | Current training phase |
done | number | Units completed (1-indexed) |
total | number | Total units in phase; guard against <= 0 before dividing |
label | string | Symbol (label phase), grid key (score phase), fold id (nested phase) |