Skip to content

Mixed effects, minmax scaling ​

match ← All flat growth benchmarks

96 daily rows with a switchable multiplicative weekly pattern, an event and a regressor.

Input ​

benchmark/inputs/v1/flat-mixed-components.json: 96 history rows and 24 forecast rows.

Output ​

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

Every forecast row from both libraries.

DateEffect ProphetPython ProphetDifference
2020-04-060.21500.21502.7e-8
2020-04-077.13217.13211.3e-7
2020-04-0836.229836.22982.3e-7
2020-04-0962.887062.88702.3e-7
2020-04-1035.002635.00261.1e-7
2020-04-1150.476150.47613.4e-8
2020-04-1219.515319.51531.8e-8
2020-04-130.21500.21502.7e-8
2020-04-148.33368.33361.4e-7
2020-04-1535.002635.00261.1e-7
2020-04-1662.887062.88702.3e-7
2020-04-1769.764269.76421.4e-7
2020-04-1850.476150.47613.4e-8
2020-04-1919.515319.51531.8e-8
2020-04-2036.204136.20411.2e-7
2020-04-217.13217.13211.3e-7
2020-04-2235.028335.02832.2e-7
2020-04-2362.887062.88702.3e-7
2020-04-2469.764269.76421.4e-7
2020-04-2535.002635.00261.1e-7
2020-04-2620.716820.71681.0e-8
2020-04-270.21500.21502.7e-8
2020-04-287.13217.13211.3e-7
2020-04-2935.028335.02832.2e-7

Timing ​

Median of all measured repetitions.

StepEffect ProphetPython ProphetEffect Prophet is
Convert input rows52 µs549 µs11× faster
Fit1.37 ms7.65 ms5.6× faster
Predict543 µs4.69 ms8.6× faster
Fit and predict1.41 ms12.4 ms8.8× faster
Convert, fit and predict1.20 ms12.9 ms11× faster
First forecast in a new process163 ms1.46 s8.9× faster
Save model to JSON24 µs669 µs28× faster
Load model from JSON133 µs3.67 ms28× faster
Load and predict in a new process155 ms1.46 s9.4× faster

Settings ​

The case declaration both libraries ran.

json
{
  "kind": "map",
  "comparison": {
    "kind": "equivalent-objective",
    "evidenceId": "flat-map-mixed-v1"
  },
  "configuration": {
    "growth": "flat",
    "scaling": "minmax",
    "seasonalityMode": "additive",
    "holidaysMode": "additive",
    "changepoints": {
      "mode": "auto",
      "count": 25,
      "range": 0.8
    },
    "changepointPriorScale": 0.05,
    "seasonalities": [
      {
        "name": "weekly-custom",
        "periodDays": 7,
        "fourierOrder": 2,
        "priorScale": 10,
        "conditionName": "active",
        "mode": "multiplicative"
      }
    ],
    "events": [
      {
        "name": "campaign",
        "date": "2020-01-22",
        "lowerWindowDays": 0,
        "upperWindowDays": 0,
        "priorScale": 10
      }
    ],
    "regressors": [
      {
        "name": "promotion",
        "priorScale": 10,
        "standardization": "never"
      }
    ]
  },
  "effectOptimizer": {
    "algorithm": "lbfgs",
    "maxIterations": 10000,
    "fallback": "none",
    "lbfgs": {
      "historySize": 5,
      "initAlpha": 0.001,
      "tolObj": 1e-12,
      "tolRelObj": 10000,
      "tolGrad": 1e-8,
      "tolRelGrad": 10000000,
      "tolParam": 1e-8
    }
  },
  "pythonOptimizer": {
    "algorithm": "LBFGS",
    "maxIterations": 10000,
    "newtonFallback": false
  }
}

Inspired by Prophet from Meta. Not affiliated with Meta.