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.
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:
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 theStart optimization
button triggers the optimizer in the background.Once the optimizer has finished running, the result can be observed in the plots below:
We find an optimal
KPI
value of about313.5K
and an uncertainty of about27.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.
In this case, we achieve a
KPI
value lightly different of313.4k
and an uncertainty of25.8k
.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 theKPI
and minimize its uncertainty) while keeping inside of the domain for the drivers. The result is therefore different, in our case: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 of300k
, to avoid extra taxes.This time, the optimal
KPI
is again300k
but we can see the driver configuration is slightly different, as we had to verify the boundary constraint on theSale price
.
Note that some configurations might not be possible to achieve,
especially while mixing constraints on the drivers and
requirements on the KPIs
.