---
url: >-
  https://jer-k.github.io/effect-prophet/benchmarks/flat/flat-mixed-components.md
---

# Mixed effects, minmax scaling

&#x20;[← All flat growth benchmarks](/benchmarks/flat)

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

## Input

[`benchmark/inputs/v1/flat-mixed-components.json`](https://github.com/jer-k/effect-prophet/blob/main/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 | 545 µs | 10× faster |
| Fit | 1.96 ms | 7.65 ms | 3.9× faster |
| Predict | 283 µs | 4.73 ms | 17× faster |
| Fit and predict | 1.38 ms | 12.3 ms | 8.9× faster |
| Convert, fit and predict | 1.48 ms | 13.4 ms | 9.0× faster |
| First forecast in a new process | 172 ms | 1.44 s | 8.4× faster |
| Save model to JSON | 28 µs | 711 µs | 25× faster |
| Load model from JSON | 145 µs | 3.72 ms | 26× faster |
| Load and predict in a new process | 164 ms | 1.43 s | 8.7× 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
  }
}
```
