Skip to content

Using the optimizer

DataStories platform features a tool to help you find optimal configurations for your KPIs. This feature is available for regression tasks, that is, when at least one of the KPIs is numerical.

What-Ifs slide

In this help, we are going to use the House price story we discussed about in our case studies.

Clicking the Optimizer button opens up a modal dialog that lets you type different kind of constraints and objectives:

Optimizer wizard

In this panel, you can decide to minimize or maximize your (numerical) KPIs, as well as their uncertainty.

Consider for example the task of maximizing the KPI while minimizing its uncertainty. Hitting the Start optimization button triggers the optimizer in the background. Running simple optimization Once the optimizer has finished running, the result can be observed in the plots below: Simple optimization results We find an optimal KPI value of about 313.5K and an uncertainty of about 27.5k.

Weighted optimization

When one has different objective to achieve, it might be important to prioritize them in a convenient way. To this purpose, one can add more weight to some optimization goals by adding stars near them.

For example, we might be interested into maximizing the house price we want to sell our house, but we exhibit a conservative profile and we would like to take as less risk as possible. In other words, we would like to give more importance to the minimization of the uncertainty. Optimization with weighted uncertainty In this case, we achieve a KPI value lightly different of 313.4k and an uncertainty of 25.8k. Optimization result with weighted uncertainty In this example, the difference with an unweighted optimization is not very big, although it might be more critical for some models where the uncertainty is higher for some configurations.

Note that in general, there is no guarantee about the uniqueness of optimizers. It is thus possible to run the optimizer consecutively and achieve optimal configurations of the targets, but significantly different configurations for the drivers, for example.

Drivers constraints

You can specify constraints on the drivers of your story, by moving the controllers on the first column of the wizard. Categorical drivers can be controlled with a selection box, while numerical drivers can be controlled by a slider. Those constraints will restrict the optimization domain.

For example, setting Overall quality to be constrained within the interval [3, 6], will ask the optimizer to achieve a target (here, maximize the KPI and minimize its uncertainty) while keeping inside of the domain for the drivers. The result is therefore different, in our case: Domain constrained optimization In this example, we observe that the optimal is a house price of about 280.9k

KPI constraints

It is also possible to bring more control over the KPI, by instructing them to comply to different constraints:

  • being at most equal to a given threshold, meaning the optimal solution sould be lower than this threshold;
  • being at least equal to a given threshold, meaning the optimal solution should be larger than this threshold;
  • being in-between two values, that is: a combination of the two previous constraints;
  • being equal to a value, which is a much stronger constraint.

For example, we might decide to maximize the Sale price of the house, but staying below a threshold of 300k, to avoid extra taxes. Optimization with constrained KPI This time, the optimal KPI is again 300k but we can see the driver configuration is slightly different, as we had to verify the boundary constraint on the Sale price.

Note that some configurations might not be possible to achieve, especially while mixing constraints on the drivers and requirements on the KPIs.


© 2024 DataStories International NV