Skip to content

Cross-validation and metrics ​

match ← All linear growth benchmarks

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

Input ​

benchmark/inputs/v1/linear-offset-scaling.json: 96 history rows and 24 forecast rows.

Output ​

Largest difference: 2.9e-11 (< 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-11107.2568107.1688107.16882.9e-11
2020-03-12107.4776107.4962107.49622.9e-11
2020-03-13107.6213107.7018107.70182.8e-11
2020-03-14107.7396107.6554107.65542.8e-11
2020-03-15107.6534107.5295107.52952.7e-11
2020-03-16107.5228107.5532107.55322.8e-11
2020-03-17107.7277107.7317107.73172.8e-11
2020-03-18108.1448108.0262108.02621.8e-11
2020-03-19108.3767108.3442108.34421.8e-11
2020-03-20108.4456108.5444108.54441.8e-11
2020-03-21108.5155108.5134108.51341.7e-11
2020-03-22108.4600108.3912108.39121.7e-11
2020-03-23108.3204108.4014108.40141.8e-11
2020-03-24108.4700108.5823108.58231.8e-11

Timing ​

Median of all measured repetitions.

StepEffect ProphetPython ProphetEffect Prophet is
Convert input rows12 µs402 µs35× faster
Plan cross-validation folds1.17 ms659 µs1.8× slower
Cross-validate9.52 ms75.7 ms8.0× faster
Compute metrics214 µs5.40 ms25× faster
Score baselines1.08 ms1.10 ms1.0× faster
First cross-validation in a new process224 ms1.48 s6.6× faster

Settings ​

The case declaration both libraries ran.

json
{
  "kind": "evaluation",
  "comparison": {
    "kind": "different-public-work",
    "evidenceId": "rolling-origin-evaluation-v1"
  },
  "configuration": {
    "growth": "linear",
    "scaling": "absmax",
    "seasonalityMode": "additive",
    "holidaysMode": "additive",
    "changepoints": {
      "mode": "explicit",
      "timestamps": [
        "2020-02-10T00:00:00.000Z"
      ]
    },
    "changepointPriorScale": 0.2,
    "seasonalities": [
      {
        "name": "weekly-custom",
        "periodDays": 7,
        "fourierOrder": 2,
        "priorScale": 10
      }
    ],
    "events": [],
    "regressors": []
  },
  "effectOptimizer": {
    "algorithm": "auto",
    "maxIterations": 10000,
    "fallback": "newton",
    "lbfgs": {
      "historySize": 5,
      "initAlpha": 0.001,
      "tolObj": 1e-12,
      "tolRelObj": 10000,
      "tolGrad": 1e-8,
      "tolRelGrad": 10000000,
      "tolParam": 1e-8
    }
  },
  "pythonOptimizer": {
    "algorithm": "Auto",
    "maxIterations": 10000,
    "newtonFallback": true,
    "sigFigs": 12
  },
  "plan": {
    "horizonMs": 604800000,
    "cutoffs": [
      "2020-03-10T00:00:00.000Z",
      "2020-03-17T00:00:00.000Z"
    ]
  },
  "metricAggregation": "overall",
  "mapeZeroActual": "exclude"
}

Inspired by Prophet from Meta. Not affiliated with Meta.