nb module¶
Numba-compiled functions for label generation.
Note
Set wait to 1 to exclude the current value from calculation of future values.
Warning
Do not attempt to use these functions for building predictor variables as they may introduce the look-ahead bias to your model - only use for building target variables.
bin_trend_labels_1d_nb function¶
Values classified into 0 (downtrend) and 1 (uptrend).
bin_trend_labels_nb function¶
2-dim version of bin_trend_labels_1d_nb().
binc_trend_labels_1d_nb function¶
Median values normalized between 0 (downtrend) and 1 (uptrend).
binc_trend_labels_nb function¶
2-dim version of binc_trend_labels_1d_nb().
bincs_trend_labels_1d_nb function¶
Median values normalized between 0 (downtrend) and 1 (uptrend) but capped once the threshold defined at the beginning of the trend is exceeded.
bincs_trend_labels_nb function¶
2-dim version of bincs_trend_labels_1d_nb().
breakout_labels_1d_nb function¶
For each value, return 1 if any value in the next period is greater than the positive threshold (in %), -1 if less than the negative threshold, and 0 otherwise.
First hit wins. Continue search if both thresholds were hit at the same time.
breakout_labels_nb function¶
2-dim version of breakout_labels_1d_nb().
fixed_labels_1d_nb function¶
Percentage change of the current value relative to a future value.
fixed_labels_nb function¶
2-dim version of fixed_labels_1d_nb().
future_max_1d_nb function¶
Rolling maximum over future values.
future_max_nb function¶
2-dim version of future_max_1d_nb().
future_mean_1d_nb function¶
Rolling average over future values.
future_mean_nb function¶
2-dim version of future_mean_1d_nb().
future_min_1d_nb function¶
Rolling minimum over future values.
future_min_nb function¶
2-dim version of future_min_1d_nb().
future_std_1d_nb function¶
Rolling standard deviation over future values.
future_std_nb function¶
2-dim version of future_std_1d_nb().
iter_symmetric_down_th_nb function¶
Negative upper threshold that is symmetric to a positive one at one iteration.
iter_symmetric_up_th_nb function¶
Positive upper threshold that is symmetric to a negative one at one iteration.
For example, 50% down requires 100% to go up to the initial level.
mean_labels_1d_nb function¶
Percentage change of the current value relative to the average of a future period.
mean_labels_nb function¶
2-dim version of mean_labels_1d_nb().
pct_trend_labels_1d_nb function¶
Percentage change of median values relative to the next pivot.
pct_trend_labels_nb function¶
2-dim version of pct_trend_labels_1d_nb().
pivots_1d_nb function¶
Pivots denoted by 1 (peak), 0 (no pivot) or -1 (valley).
Two adjacent peak and valley points should exceed the given threshold parameters.
If any threshold is given element-wise, it will be applied per new/updated pivot.
pivots_nb function¶
2-dim version of pivots_1d_nb().
trend_labels_1d_nb function¶
Trend labels based on TrendLabelMode.
trend_labels_nb function¶
2-dim version of trend_labels_1d_nb().