Skip to content

Events with windows ​

match ← All linear growth benchmarks

96 daily rows with six event dates, including days before and after each one.

Input ​

benchmark/inputs/v1/map-events-small.json: 96 history rows and 28 forecast rows.

Output ​

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

Every forecast row from both libraries.

DateEffect ProphetPython ProphetDifference
2020-04-0645.377645.37767.3e-12
2020-04-0745.707445.70747.3e-12
2020-04-0846.037246.03727.3e-12
2020-04-0946.367046.36707.2e-12
2020-04-1046.696846.69687.2e-12
2020-04-1147.026647.02667.2e-12
2020-04-1247.356447.35647.2e-12
2020-04-1347.686247.68627.2e-12
2020-04-1448.016048.01607.2e-12
2020-04-1550.902650.90265.5e-12
2020-04-1651.562851.56284.8e-12
2020-04-1751.902551.90256.8e-12
2020-04-1851.782551.78256.1e-12
2020-04-1949.664949.66497.1e-12
2020-04-2049.994749.99477.0e-12
2020-04-2150.324550.32457.0e-12
2020-04-2248.442948.44295.7e-12
2020-04-2348.702648.70267.3e-12
2020-04-2451.313951.31397.0e-12
2020-04-2551.643751.64377.0e-12
2020-04-2651.973551.97356.9e-12
2020-04-2752.303352.30336.9e-12
2020-04-2852.633152.63316.9e-12
2020-04-2952.962952.96296.9e-12
2020-04-3053.292753.29276.9e-12
2020-05-0153.622553.62256.8e-12
2020-05-0253.952353.95236.8e-12
2020-05-0354.282154.28216.8e-12

Timing ​

Median of all measured repetitions.

StepEffect ProphetPython ProphetEffect Prophet is
Convert input rows17 µs479 µs28× faster
Fit7.18 ms28.9 ms4.0× faster
Predict331 µs4.21 ms13× faster
Fit and predict6.77 ms33.1 ms4.9× faster
Convert, fit and predict6.68 ms34.3 ms5.1× faster
First forecast in a new process177 ms1.44 s8.1× faster
Save model to JSON26 µs632 µs24× faster
Load model from JSON184 µs3.41 ms19× faster
Load and predict in a new process158 ms1.43 s9.0× 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-02-10T00:00:00.000Z"
      ]
    },
    "changepointPriorScale": 0.2,
    "seasonalities": [],
    "events": [
      {
        "name": "release",
        "date": "2020-01-21",
        "lowerWindowDays": -1,
        "upperWindowDays": 2,
        "priorScale": 10
      },
      {
        "name": "release",
        "date": "2020-02-20",
        "lowerWindowDays": -1,
        "upperWindowDays": 2,
        "priorScale": 10
      },
      {
        "name": "release",
        "date": "2020-04-16",
        "lowerWindowDays": -1,
        "upperWindowDays": 2,
        "priorScale": 10
      },
      {
        "name": "campaign",
        "date": "2020-01-22",
        "lowerWindowDays": -1,
        "upperWindowDays": 0,
        "priorScale": 6
      },
      {
        "name": "campaign",
        "date": "2020-03-04",
        "lowerWindowDays": -1,
        "upperWindowDays": 0,
        "priorScale": 6
      },
      {
        "name": "campaign",
        "date": "2020-04-23",
        "lowerWindowDays": -1,
        "upperWindowDays": 0,
        "priorScale": 6
      }
    ],
    "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.