Skip to content

Cross-validation with repeated timestamps ​

match ← All linear growth benchmarks

Folds over rows with repeated dates. Each repeated row is scored separately.

Input ​

benchmark/inputs/v1/training-duplicates.json: 96 history rows and 8 forecast rows.

Output ​

Largest difference: 1.2e-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-01-1914.826514.748814.74881.2e-11
2020-01-1914.941914.748814.74881.2e-11
2020-01-1914.931114.748814.74881.2e-11
2020-01-1914.797614.748814.74881.2e-11
2020-01-2015.011914.920014.92001.2e-11
2020-01-2015.111214.920014.92001.2e-11
2020-01-2015.194814.920014.92001.2e-11
2020-01-2015.093214.920014.92001.2e-11
2020-01-2115.225515.091115.09111.2e-11
2020-01-2115.244115.091115.09111.2e-11
2020-01-2115.368515.091115.09111.2e-11
2020-01-2115.327015.091115.09111.2e-11
2020-01-2015.011915.073815.07386.3e-12
2020-01-2015.111215.073815.07386.3e-12
2020-01-2015.194815.073815.07386.3e-12
2020-01-2015.093215.073815.07386.3e-12
2020-01-2115.225515.298015.29806.6e-12
2020-01-2115.244115.298015.29806.6e-12
2020-01-2115.368515.298015.29806.6e-12
2020-01-2115.327015.298015.29806.6e-12
2020-01-2215.539415.522115.52217.0e-12
2020-01-2215.465915.522115.52217.0e-12
2020-01-2215.567615.522115.52217.0e-12
2020-01-2215.581015.522115.52217.0e-12

Timing ​

Median of all measured repetitions.

StepEffect ProphetPython ProphetEffect Prophet is
Plan cross-validation folds1.11 ms945 µsNot compared: different work
Cross-validate6.85 ms53.4 msNot compared: different work
Score baselines968 µs1.40 msNot compared: different work
Search settings5.79 ms56.6 msNot compared: different work
Final holdout check3.85 ms22.2 msNot compared: different work
Save report236 µs8 µsNot compared: different work
Load report219 µs4 µsNot compared: different work

Some steps aren't compared, because the two libraries' public calls produce different outputs. Their times show what each call costs, not which library is faster.

  • Plan cross-validation folds, Cross-validate, Score baselines, Search settings, Final holdout check, Save report, Load report: Python Prophet's cross-validation returns different outputs, and baselines, search and holdout reports have no Python API, so the benchmark times equivalent application code. The two libraries also compute ranges and some metrics differently.

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-01-17T00:00:00.000Z"
      ]
    },
    "changepointPriorScale": 0.05,
    "seasonalities": [],
    "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": 259200000,
    "cutoffs": [
      "2020-01-18T00:00:00.000Z",
      "2020-01-19T00:00:00.000Z"
    ]
  },
  "metricAggregation": "overall",
  "candidates": [
    {
      "id": "control",
      "changepointPriorScale": 0.05
    }
  ],
  "holdoutRows": 8
}

Inspired by Prophet from Meta. Not affiliated with Meta.