parcel

We consider an at-order prediction setting that uses only attributes available at the moment a parcel is accepted into the system. Let

D={⁢(xi⁢ymathrm⁡(ETA)⁢ymathrm⁡(PTC)⁢ci)⁢}N D equals the set open paren x sub i y raised to the mathrm of open paren ETA close paren power y raised to the mathrm of open paren PTC close paren power c sub i close paren times to the N power

where xi x sub i is a typed feature vector observed at acceptance time tmathrm⁡(acc) t raised to the mathrm of open paren acc close paren power. We define two primary targets. The first is a continuous time-to-event label

ymathrm⁡(ETA)=hours⁢!⁢big⁢(tmathrm⁡(succ)-tmathrm⁡(acc)⁢big) y raised to the mathrm of open paren ETA close paren power equals number h o u r s factorial number b i g times open paren t raised to the mathrm of open paren succ close paren power minus t raised to the mathrm of open paren acc close paren power number b i g close paren

where tmathrm⁡(succ) t raised to the mathrm of open paren succ close paren power is the timestamp of the first successful delivery attempt. The second is a binary first-attempt success label

ymathrm⁡(PTC)∈{⁢0⁢1⁢} y raised to the mathrm of open paren PTC close paren power is a member of the set 0 1

with ymathrm⁡(PTC)=1 y raised to the mathrm of open paren PTC close paren power equals 1 if and only if the first attempt succeeds. Because some items never achieve a first success within the business horizon, we attach a right-censoring flag ci∈{⁢0⁢1⁢} c sub i is a member of the set 0 1, with ci=1 c sub i equals 1 when tmathrm⁡(succ) t raised to the mathrm of open paren succ close paren power is observed and ci=0 c sub i equals 0 for returns, cancellations, or unresolved cases. The model fθ f sub theta maps x x to two outputs used by operations:

fθ⁢(x)=big⁢(ymathrm⁡(ETA)⁢;⁢pmathrm⁡(PTC)⁢big) f sub theta times x equals number b i g times open paren y raised to the mathrm of open paren ETA close paren power semicolon p raised to the mathrm of open paren PTC close paren power number b i g close paren

where ymathrm⁡(ETA) y raised to the mathrm of open paren ETA close paren power is a point estimate of ymathrm⁡(ETA) y raised to the mathrm of open paren ETA close paren power and pmathrm⁡(PTC)=Pr⁢(ymathrm⁡(PTC)=1|x) p raised to the mathrm of open paren PTC close paren power equals probability times open paren y raised to the mathrm of open paren PTC close paren power equals 1 divides x close paren is a calibrated probability for first-attempt success. For ETA we report point-error metrics,

mathrm⁡(MAE)=1|E|⁢∑i∈E((xi)⁢big|quad⁢mathrm⁡(RMSE))⁢Bigg⁢(1|E|⁢∑i∈E((ymathrm⁡(ETA)-ymathrm⁡(ETA)⁢(xi)⁢big)2⁢Bigg!⁢1/2)) mathrm of open paren MAE close paren equals the fraction with numerator 1 and denominator the absolute value of E the sum over i is a member of E of open paren open paren x sub i close paren times number b i g divides number q u a d mathrm of open paren RMSE close paren close paren number B i g g times open paren the fraction with numerator 1 and denominator the absolute value of E the sum over i is a member of E of open paren open paren y raised to the mathrm of open paren ETA close paren power minus y raised to the mathrm of open paren ETA close paren power times open paren x sub i close paren times number b i g close paren squared times number B i g g raised to the factorial 1 divided by 2 power close paren close paren

together with tail summaries mathrm⁡(P90Err) mathrm of open paren cap P 90 Err close paren and mathrm⁡(P95Err) mathrm of open paren cap P 95 Err close paren defined as the 90th and 95th percentiles of |ymathrm⁡(ETA)-ymathrm⁡(ETA)| vertical bar y raised to the mathrm of open paren ETA close paren power minus y raised to the mathrm of open paren ETA close paren power vertical bar on the evaluation set E E. For PTC we adopt two complementary classification metrics: i \emph{ROC-AUC} area under the receiver operating characteristic curve, which is threshold-free and measures the probability that a randomly chosen positive example receives a higher score than a randomly chosen negative. Formally, if s(x)=pmathrm⁡(PTC) s of x equals p raised to the mathrm of open paren PTC close paren power denotes the score, then

mathrm⁡(AUC)=Pr⁢big⁢(s⁢(X+)⁢>s⁢(X-)⁢big) mathrm of open paren AUC close paren equals probability number b i g times open paren s times open paren X plus close paren times is greater than s times open paren X minus close paren times number b i g close paren

making it insensitive to any monotone calibration of s⁢(⋅) s times open paren times close paren and robust under class imbalance. ii \emph{F1 score}, the harmonic mean of precision and recall after thresholding the probability at τ tau:

mathrm⁡(Precision)=mathrm⁡(TP)mathrm⁡(TP)+mathrm⁡(FP)⁢quad⁢mathrm⁡(Recall)=mathrm⁡(TP)mathrm⁡(TP)+mathrm⁡(FN)⁢quad⁢mathrm⁡(F1)=2⋅mathrm⁡(Precision)⋅mathrm⁡(Recall)mathrm⁡(Precision)+mathrm⁡(Recall)⁢. mathrm of open paren Precision close paren equals the fraction with numerator mathrm of open paren TP close paren and denominator mathrm of open paren TP close paren plus mathrm of open paren FP close paren number q u a d mathrm of open paren Recall close paren equals the fraction with numerator mathrm of open paren TP close paren and denominator mathrm of open paren TP close paren plus mathrm of open paren FN close paren number q u a d mathrm of open paren cap F 1 close paren equals the fraction with numerator 2 times mathrm of open paren Precision close paren times mathrm of open paren Recall close paren and denominator mathrm of open paren Precision close paren plus mathrm of open paren Recall close paren period

We select τ tau on the validation split by maximizing F1, unless otherwise specified and then report test-set F1 at that fixed τ tau. This provides an operational view of the success/failure trade-off complementary to AUC’s ranking perspective. For transparency, we also report the associated precision and recall at the chosen τ tau. Features are computed exclusively from the acceptance-time state; aggregates e.g., per–post-office or per–day load use leave-one-out logic so the index parcel does not influence its own features. Categorical vocabularies and numeric normalizers are fit on training data and then frozen. Personally identifiable information such as names, phone numbers, and exact street numbers is dropped or hashed before modeling. Data are split chronologically by tmathrm⁡(acc) t raised to the mathrm of open paren acc close paren power into // train/validation/test segments, and we also perform rolling-origin evaluation. Portability and equity are assessed via leave-one-district/post-office-out generalization and parity gaps such as Δ=maxd⁡(mathrm⁡(MAE))-mind⁡(mathrm⁡(MAE)) triangle equals max over d of open paren mathrm of open paren MAE close paren close paren minus min over d of open paren mathrm of open paren MAE close paren close paren with analogous gaps for classification metrics. Training uses a joint objective that couples robust regression with probabilistic classification:

L(θ)=wmathrm⁡(ETA)⋅mathrm⁡(Huber)⁢big⁢(ymathrm⁡(ETA)⁢ymathrm⁡(ETA)⁢big)⋅ind⁡(c=1)+wmathrm⁡(PTC)⋅mathrm⁡(BCE)⁢big⁢(ymathrm⁡(PTC)⁢pmathrm⁡(PTC)⁢big)+λ⁢|⁢θ⁢|2. L of open paren theta close paren equals w sub mathrm of open paren ETA close paren times mathrm of open paren Huber close paren number b i g times open paren y raised to the mathrm of open paren ETA close paren power y raised to the mathrm of open paren ETA close paren power number b i g close paren times ind of open paren c equals 1 close paren plus w sub mathrm of open paren PTC close paren times mathrm of open paren BCE close paren number b i g times open paren y raised to the mathrm of open paren PTC close paren power p raised to the mathrm of open paren PTC close paren power number b i g close paren plus lamda the absolute value of theta raised to the 2 period power

Weights (wmathrm⁡(ETA)⁢wmathrm⁡(PTC)) open paren w sub mathrm of open paren ETA close paren w sub mathrm of open paren PTC close paren close paren are fixed to /; PTC class imbalance is handled by inverse-frequency weights. We optimize with AdamW, cosine learning-rate decay with warmup, dropout in attention and MLP blocks, and early stopping on a composite validation score Smathrm⁡(val)=mathrm⁡(MAE)+0.5⋅mathrm⁡(P90Err)+0.5⋅(1-mathrm⁡(AUC)) S sub mathrm of open paren val close paren equals mathrm of open paren MAE close paren plus 0.5 times mathrm of open paren cap P 90 Err close paren plus 0.5 times open paren 1 minus mathrm of open paren AUC close paren close paren. After training we calibrate pmathrm⁡(PTC) p raised to the mathrm of open paren PTC close paren power using temperature scaling or isotonic regression on the validation split note that AUC is invariant to monotone calibration, while F1 may change through threshold re-optimization.