Skip to content

Two switchable weekly patterns ​

match flagged ← All linear growth benchmarks

256 daily rows. One weekly pattern applies on dense days, another on sparse days.

Input ​

benchmark/inputs/v1/map-conditional-seasonalities-medium.json: 256 history rows and 64 forecast rows.

Output ​

Largest difference: 0.0027 (0.0028% of the input's range).

Every forecast row from both libraries.

DateEffect ProphetPython ProphetDifference
2020-09-13108.2021108.20120.00090
2020-09-14107.1673107.16640.00091
2020-09-15108.2711108.27010.0010
2020-09-16110.0093110.00840.00094
2020-09-17111.0944111.09340.0010
2020-09-18111.5652111.56420.00094
2020-09-19111.9707111.96950.0011
2020-09-20111.3706111.36950.0011
2020-09-21112.2118112.21060.0011
2020-09-22111.7796111.77830.0012
2020-09-23113.1091113.10720.0019
2020-09-24114.6028114.60160.0012
2020-09-25115.0736115.07250.0011
2020-09-26115.4791115.47770.0013
2020-09-27114.8790114.87770.0013
2020-09-28114.1842114.18290.0013
2020-09-29116.2214116.22000.0014
2020-09-30117.0262117.02480.0013
2020-10-01118.1113118.10980.0014
2020-10-02118.5820118.58070.0013
2020-10-03119.9595119.95850.0010
2020-10-04118.3874118.38590.0015
2020-10-05117.6926117.69110.0015
2020-10-06118.7964118.79480.0016
2020-10-07120.2310120.22940.0016
2020-10-08121.6197121.61810.0016
2020-10-09122.0905122.08890.0015
2020-10-10122.4959122.49420.0017
2020-10-11121.8959121.89420.0017
2020-10-12121.8381121.83670.0014
2020-10-13122.3049122.30300.0018
2020-10-14124.0430124.04130.0017
2020-10-15124.2407124.23890.0018
2020-10-16125.5989125.59720.0017
2020-10-17126.0044126.00240.0019
2020-10-18125.4043125.40240.0019
2020-10-19124.7095124.70760.0019
2020-10-20125.8133125.81130.0020
2020-10-21127.5515127.54950.0019
2020-10-22128.6366128.63450.0020
2020-10-23128.2503128.24830.0020
2020-10-24129.5128129.51070.0021
2020-10-25128.9127128.91060.0021
2020-10-26128.8549128.85310.0018
2020-10-27129.3217129.31950.0022
2020-10-28131.0599131.05780.0021
2020-10-29132.1450132.14280.0022
2020-10-30132.6158132.61360.0021
2020-10-31133.2319133.23020.0017
2020-11-01132.4212132.41890.0023
2020-11-02131.7263131.72400.0023
2020-11-03132.8301132.82770.0024
2020-11-04134.5683134.56600.0023
2020-11-05135.6534135.65100.0024
2020-11-06136.1242136.12190.0023
2020-11-07136.5297136.52710.0025
2020-11-08136.2696136.26710.0025
2020-11-09135.2347135.23230.0025
2020-11-10136.3386136.33600.0026
2020-11-11138.0768138.07420.0025
2020-11-12139.1619139.15920.0026
2020-11-13139.6326139.63010.0025
2020-11-14140.0381140.03540.0027
2020-11-15139.4380139.43530.0027

Internal fit differences ​

The forecasts match, so this case passes. Both libraries search for the best-fitting parameters and stop when they are close enough. On this input they stopped at slightly different points, so these internal numbers differ by more than the threshold where we take a closer look.

CheckEffect ProphetPython ProphetThreshold
Stationarity residual (lower is closer to the best fit)20.98286.11130.01

Timing ​

Median of all measured repetitions.

StepEffect ProphetPython ProphetEffect Prophet is
Convert input rows75 µs617 µs8.2× faster
Fit3.69 ms11.8 ms3.2× faster
Predict527 µs3.90 ms7.4× faster
Fit and predict3.11 ms15.7 ms5.0× faster
Convert, fit and predict2.60 ms16.2 ms6.2× faster
First forecast in a new process174 ms1.42 s8.2× faster
Save model to JSON20 µs646 µs32× faster
Load model from JSON103 µs2.70 ms26× faster
Load and predict in a new process158 ms1.42 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-03-21T00:00:00.000Z",
        "2020-06-29T00:00:00.000Z"
      ]
    },
    "changepointPriorScale": 0.2,
    "seasonalities": [
      {
        "name": "weekly-dense",
        "periodDays": 7,
        "fourierOrder": 3,
        "priorScale": 10,
        "conditionName": "dense"
      },
      {
        "name": "weekly-sparse",
        "periodDays": 7,
        "fourierOrder": 3,
        "priorScale": 8,
        "conditionName": "sparse"
      }
    ],
    "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.