Mixed effects, minmax scaling
match ← All flat growth benchmarks96 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.
| Date | Effect Prophet | Python Prophet | Difference |
|---|---|---|---|
| 2020-04-06 | 0.2150 | 0.2150 | 2.7e-8 |
| 2020-04-07 | 7.1321 | 7.1321 | 1.3e-7 |
| 2020-04-08 | 36.2298 | 36.2298 | 2.3e-7 |
| 2020-04-09 | 62.8870 | 62.8870 | 2.3e-7 |
| 2020-04-10 | 35.0026 | 35.0026 | 1.1e-7 |
| 2020-04-11 | 50.4761 | 50.4761 | 3.4e-8 |
| 2020-04-12 | 19.5153 | 19.5153 | 1.8e-8 |
| 2020-04-13 | 0.2150 | 0.2150 | 2.7e-8 |
| 2020-04-14 | 8.3336 | 8.3336 | 1.4e-7 |
| 2020-04-15 | 35.0026 | 35.0026 | 1.1e-7 |
| 2020-04-16 | 62.8870 | 62.8870 | 2.3e-7 |
| 2020-04-17 | 69.7642 | 69.7642 | 1.4e-7 |
| 2020-04-18 | 50.4761 | 50.4761 | 3.4e-8 |
| 2020-04-19 | 19.5153 | 19.5153 | 1.8e-8 |
| 2020-04-20 | 36.2041 | 36.2041 | 1.2e-7 |
| 2020-04-21 | 7.1321 | 7.1321 | 1.3e-7 |
| 2020-04-22 | 35.0283 | 35.0283 | 2.2e-7 |
| 2020-04-23 | 62.8870 | 62.8870 | 2.3e-7 |
| 2020-04-24 | 69.7642 | 69.7642 | 1.4e-7 |
| 2020-04-25 | 35.0026 | 35.0026 | 1.1e-7 |
| 2020-04-26 | 20.7168 | 20.7168 | 1.0e-8 |
| 2020-04-27 | 0.2150 | 0.2150 | 2.7e-8 |
| 2020-04-28 | 7.1321 | 7.1321 | 1.3e-7 |
| 2020-04-29 | 35.0283 | 35.0283 | 2.2e-7 |
Timing
Median of all measured repetitions.
| Step | Effect Prophet | Python Prophet | Effect Prophet is |
|---|---|---|---|
| Convert input rows | 52 µs | 549 µs | 11× faster |
| Fit | 1.37 ms | 7.65 ms | 5.6× faster |
| Predict | 543 µs | 4.69 ms | 8.6× faster |
| Fit and predict | 1.41 ms | 12.4 ms | 8.8× faster |
| Convert, fit and predict | 1.20 ms | 12.9 ms | 11× faster |
| First forecast in a new process | 163 ms | 1.46 s | 8.9× faster |
| Save model to JSON | 24 µs | 669 µs | 28× faster |
| Load model from JSON | 133 µs | 3.67 ms | 28× faster |
| Load and predict in a new process | 155 ms | 1.46 s | 9.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
}
}