Skip to content

Cross-validation and metrics ​

match ← All flat growth benchmarks

Three rolling cutoffs, a 7-day horizon, all metrics and a baseline comparison.

Input ​

benchmark/inputs/v1/flat-mixed-components.json: 96 history rows and 24 forecast rows.

Output ​

Largest difference: 2.8e-7 (< 0.0001% of the input's range).

Each row is one forecast made during cross-validation, next to the value that actually happened.

DateActualEffect ProphetPython ProphetDifference
2020-03-0435.077534.978034.97801.2e-7
2020-03-0545.887245.940545.94053.0e-8
2020-03-0634.942335.001935.00191.0e-7
2020-03-0741.121841.064541.06457.7e-9
2020-03-0828.913328.893928.89391.7e-7
2020-03-0922.436522.577522.57752.8e-7
2020-03-1024.028324.082624.08262.6e-7
2020-03-1135.056835.002135.00211.0e-7
2020-03-1245.907845.939845.93989.8e-8
2020-03-1348.586648.677548.67752.6e-8
2020-03-1441.145541.075941.07591.0e-8
2020-03-1530.207530.088130.08814.7e-8
2020-03-1634.966535.002135.00211.0e-7
2020-03-1724.057624.079524.07951.9e-7
2020-03-1835.104834.989734.98973.0e-9
2020-03-1945.966845.933045.93308.4e-8
2020-03-2048.570848.667548.66755.7e-8
2020-03-2136.207036.203736.20375.4e-8
2020-03-2228.974128.907128.90711.7e-7
2020-03-2321.275121.355921.35592.0e-7
2020-03-2423.959824.074624.07461.2e-7

Timing ​

Median of all measured repetitions.

StepEffect ProphetPython ProphetEffect Prophet is
Convert input rows68 µs386 µs5.7× faster
Plan cross-validation folds1.49 ms741 µs2.0× slower
Cross-validate6.50 ms46.1 ms7.1× faster
Compute metrics218 µs5.34 ms24× faster
Score baselines1.28 ms1.46 ms1.1× faster
First cross-validation in a new process185 ms1.47 s7.9× faster

Settings ​

The case declaration both libraries ran.

json
{
  "kind": "evaluation",
  "comparison": {
    "kind": "different-public-work",
    "evidenceId": "rolling-origin-evaluation-v1"
  },
  "configuration": {
    "growth": "flat",
    "scaling": "minmax",
    "seasonalityMode": "additive",
    "holidaysMode": "additive",
    "changepoints": {
      "mode": "auto",
      "count": 25,
      "range": 0.8
    },
    "changepointPriorScale": 0.05,
    "seasonalities": [
      {
        "name": "weekly-custom",
        "periodDays": 7,
        "fourierOrder": 2,
        "priorScale": 10,
        "conditionName": "active",
        "mode": "multiplicative"
      }
    ],
    "events": [
      {
        "name": "campaign",
        "date": "2020-01-22",
        "lowerWindowDays": 0,
        "upperWindowDays": 0,
        "priorScale": 10
      }
    ],
    "regressors": [
      {
        "name": "promotion",
        "priorScale": 10,
        "standardization": "never"
      }
    ]
  },
  "effectOptimizer": {
    "algorithm": "lbfgs",
    "maxIterations": 10000,
    "fallback": "none",
    "lbfgs": {
      "historySize": 5,
      "initAlpha": 0.001,
      "tolObj": 1e-12,
      "tolRelObj": 10000,
      "tolGrad": 1e-8,
      "tolRelGrad": 10000000,
      "tolParam": 1e-8
    }
  },
  "pythonOptimizer": {
    "algorithm": "LBFGS",
    "maxIterations": 10000,
    "newtonFallback": false
  },
  "plan": {
    "horizonMs": 604800000,
    "cutoffs": [
      "2020-03-03T00:00:00.000Z",
      "2020-03-10T00:00:00.000Z",
      "2020-03-17T00:00:00.000Z"
    ]
  },
  "metricAggregation": "horizons",
  "mapeZeroActual": "exclude"
}

Inspired by Prophet from Meta. Not affiliated with Meta.