HyperFlow / docs /benchmark_methodology.md
Gaurav711's picture
deploy: revert to 733e96b
d491dc1
|
Raw
History Blame Contribute Delete
4.1 kB

HyperFlow: ML Benchmark & Evaluation Methodology

System Evaluation Criteria & Mathematical Proofs


1. Monte Carlo Simulation Framework

To evaluate model stability under highly noisy and censored hyperlocal conditions, HyperFlow runs a 500-trial Monte Carlo simulation framework. Each trial generates simulated order logs, telemetry GPS vectors, user complaints, and cancellation coordinates.

       +---------------------------------------------+
       |   Monte Carlo Data Generation (500 Trials)  |
       +---------------------------------------------+
                              |
       +----------------------+----------------------+
       |                                             |
[Out-of-Stock Censoring]                     [Storm Surge Telemetry]
       |                                             |
[OLS vs Tobit Estimator]                      [EWMA vs Gated Forest]
       |                                             |
+----------------------+----------------------+------+
                       |
        +------------------------------+
        |  Wasserstein Distance Calc   |
        +------------------------------+

2. Tobit Parameter Recovery & Wasserstein Distance

Tobit MLE Log-Likelihood

Our Tobit regression model accounts for censored sales values on stockout days. The parameter recovery process estimates how close our estimated coefficients ($\hat{\beta}$) are to the true latent demand coefficients ($\beta_{\text{true}}$). The log-likelihood function minimized by the backend L-BFGS-B solver is:

[L(\beta, \sigma) = \sum_{y_i > 0} \ln \left( \frac{1}{\sigma_i} \phi\left(\frac{y_i - X_i\beta}{\sigma_i}\right) \right) + \sum_{y_i = 0} \ln \left( 1 - \Phi\left(\frac{X_i\beta}{\sigma_i}\right) \right)]

Where:

  • (\phi(\cdot)) is the standard normal PDF.
  • (\Phi(\cdot)) is the standard normal CDF.
  • (\sigma_i) is the heteroscedastic scale parameter modeled as (\log(\sigma_i) = X_i\gamma).

Wasserstein Distance Evaluation

To prove that our Tobit model recovers the true demand distribution rather than simply predicting the mean, we calculate the 1st Wasserstein Distance (Earth Mover's Distance) between the predicted demand distribution ((P_{\text{pred}})) and the true demand distribution ((P_{\text{true}})):

[W_1(P_{\text{pred}}, P_{\text{true}}) = \int_{-\infty}^{\infty} |F_{\text{pred}}(x) - F_{\text{true}}(x)| , dx]

  • OLS Baseline: As censoring rates increase to 60%, the OLS Wasserstein distance degrades to 12.38 due to severe downward bias.
  • Tobit MLE: Our model maintains a Wasserstein distance of 3.65, preserving the underlying distribution alignment.

3. Gated Random Forest ETA Convergence

Display ETA jitter is suppressed by classifying location updates. The Gated Classifier evaluates the residual convergence rate over a moving window:

[\text{Residual}(t) = |\text{ActualDeliveryTime} - \text{PredictedETA}(t)|]

If the location update fails to converge toward the actual delivery trajectory, it is flagged as a transient GPS jump:

[\text{Jitter Flag} = \text{Classifier}\left( \frac{v_{\text{rider}}}{v_{\text{zone}}}, \text{GPS_Accuracy_Index}, \Delta\text{Heading} \right)]

  • Jitter Active: The smoothing parameter $\alpha$ drops to 0.15 to hold the consumer's display clock stable.
  • Real Delay Active: The smoothing parameter $\alpha$ rises to 0.70 to pass the delay information immediately.

4. Anti-Arbitrage Proximity Thresholds

The Cancelled Order Resale (CORO) engine restricts discount exploits by verifying buyer proximity coordinates using the Haversine Distance Formula:

[d = 2R \arcsin \left( \sqrt{\sin^2\left(\frac{\Delta\phi}{2}\right) + \cos(\phi_1)\cos(\phi_2)\sin^2\left(\frac{\Delta\lambda}{2}\right)} \right)]

Where:

  • (\phi) is latitude, (\lambda) is longitude.
  • (R) is Earth's radius (6371 km).
  • Exclusion Policy: Any claim where (d < 15\text{ meters}) from the original canceller's coordinates triggers a co-location exclusion alert.