Skip to content

Weekly pattern on irregular dates ​

match ← All linear growth benchmarks

192 unevenly spaced rows with a custom weekly seasonality and two changepoints.

Input ​

benchmark/inputs/v1/map-irregular-medium.json: 192 history rows and 48 forecast rows.

Output ​

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

Every forecast row from both libraries.

DateEffect ProphetPython ProphetDifference
2020-08-1784.472184.47203.6e-5
2020-08-1884.745784.74571.9e-5
2020-08-1985.313285.31323.1e-5
2020-08-2085.887585.88754.4e-5
2020-08-2286.663186.66314.8e-5
2020-08-2387.071887.07183.5e-5
2020-08-2487.477187.47704.0e-5
2020-08-2587.750787.75072.2e-5
2020-08-2688.318288.31823.5e-5
2020-08-2788.892588.89254.8e-5
2020-08-2889.147189.14704.6e-5
2020-08-3090.076890.07683.9e-5
2020-08-3190.482090.48204.3e-5
2020-09-0190.755790.75562.6e-5
2020-09-0291.323291.32313.8e-5
2020-09-0391.897591.89745.1e-5
2020-09-0492.152192.15204.9e-5
2020-09-0693.081893.08184.2e-5
2020-09-0893.760693.76062.9e-5
2020-09-0994.328294.32814.2e-5
2020-09-1094.902594.90245.5e-5
2020-09-1195.157095.15705.3e-5
2020-09-1295.678095.67805.8e-5
2020-09-1396.086896.08674.6e-5
2020-09-1496.492096.49195.0e-5
2020-09-1697.333197.33314.5e-5
2020-09-1797.907497.90745.8e-5
2020-09-1898.162098.16205.6e-5
2020-09-1998.683098.68296.2e-5
2020-09-2099.091799.09174.9e-5
2020-09-2199.497099.49695.4e-5
2020-09-2299.770699.77063.6e-5
2020-09-24100.9124100.91246.2e-5
2020-09-25101.1670101.16696.0e-5
2020-09-26101.6880101.68796.5e-5
2020-09-27102.0967102.09675.3e-5
2020-09-29102.7756102.77554.0e-5
2020-09-30103.3431103.34305.2e-5
2020-10-01103.9174103.91736.5e-5
2020-10-03104.6930104.69296.9e-5
2020-10-04105.1017105.10165.6e-5
2020-10-05105.5069105.50696.1e-5
2020-10-06105.7806105.78054.3e-5
2020-10-07106.3481106.34805.6e-5
2020-10-08106.9224106.92236.9e-5
2020-10-09107.1769107.17696.7e-5
2020-10-11108.1067108.10666.0e-5
2020-10-12108.5119108.51186.4e-5

Timing ​

Median of all measured repetitions.

StepEffect ProphetPython ProphetEffect Prophet is
Convert input rows30 µs533 µs17× faster
Fit2.00 ms8.05 ms4.0× faster
Predict399 µs3.17 ms7.9× faster
Fit and predict1.49 ms11.3 ms7.6× faster
Convert, fit and predict1.57 ms11.6 ms7.4× faster
Save model to JSON17 µs515 µs30× faster
Load model from JSON95 µs2.35 ms25× faster
Load and predict in a new process165 ms1.42 s8.6× faster

Settings ​

The case declaration both libraries ran.

json
{
  "kind": "linear-map",
  "comparison": {
    "kind": "equivalent-objective",
    "evidenceId": "linear-output-first-v4"
  },
  "configuration": {
    "effectMap": "explicit",
    "changepoints": {
      "mode": "explicit",
      "timestamps": [
        "2020-03-26T00:00:00.000Z",
        "2020-06-09T00:00:00.000Z"
      ]
    },
    "changepointPriorScale": 0.2,
    "seasonalities": [
      {
        "name": "weekly-custom",
        "periodDays": 7,
        "fourierOrder": 3,
        "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
  }
}

Inspired by Prophet from Meta. Not affiliated with Meta.