Getting started
My first Optimization
Last updated
My first Optimization
Last updated
In order to generate optimisations with Verteego, you will need to:
Create datasets
Create a configuration file
Create a pipeline run.
See the Concepts page for a description of the general concepts used below (Datasource, Dataset, Pipeline, etc.).
Here, we will look at three examples of optimization, which represent the three main categories of optimization addressed by the Verteego platform:
Optimisation of a variable
Scenario selection
Optimisation of a variable and selection of scenarios
For each of these 3 cases, you will need to :
Create the pipeline :
In Pipelines Tab, click on “New” in order to create a pipeline of type optimisation :
Add the relevant datasets :
In Data Tab → Datasets, click on New to create a dataset. If your datasets are CSV files of less than 50 MB, you can go directly to the Data>Datasets section and add a dataset (select the 'Upload File' data source, and click on 'Choose file' to upload your file). If however your dataset is in the Cloud, we support a number of Connectors which you can use to create a datasource (Data>Datasources), and then create datasets from this source.
Set up the configuration file
Launch a pipeline_run
First, you need to create a pipeline on the platform. In the Pipelines section, create a new Optimization pipeline.
Let's say we want to optimise daily car rental prices for different rental periods.
Data overview:
In our example, we have 3 vehicles (vehicle A, vehicle B and vehicle C), 3 rental periods (1D, 7D, 14D), the price of the competition and the price of the competition plus 30%.
Vehicle A
1J
38
49
Vehicle A
7J
37
48
Vehicle A
14J
34
44
Vehicle B
1J
39
51
Vehicle B
7J
36
47
Vehicle B
14J
33
43
Vehicle C
1J
41
53
Vehicle C
7J
38
49
Vehicle C
14J
37
48
Then, you need to create the system. The system contains the keys that uniquely identify the variables (Vehicle, Duration) and the columns that are useful for optimisation (Competition_price, Competition_upper_bound_price).
You need to upload your system dataset on the platform:
Once your system dataset has been uploaded and validated on the platform, you need to create the configuration file.
Configuration:
You need to set up the initial configuration of your optimisation pipeline.
Goal:
In our example, we want to maximise the price of the vehicles, and ensure that these prices are higher than the competition's prices and lower than the competition's prices plus 30%.
Variables:
First of all, you need to fill in everything relating to the variables :
variables : the name of the variable to optimise. In this example, we want to optimize the price.
variable_types : type of the variable to optimise. Could be int, float, bool. In this example, we want integer prices.
variable_keys : keys that uniquely identify the variables. In this example, the price is indexed by a vehicle and a duration.
Then you need to determine the objective of the optimisation. There are two ways of computing the objective: the sum of a column or the weighted sum of two columns. You need to specify :
objective_method : max or min, whether you want to maximize or minimize the objective. In this example, we want to maximize the price.
weighted_objective_columns : column(s) used as the optimisation objective. In this example, it is the price.
Constraints:
Afterwards, you need to define the set of constraints :
lower_bound_on_price : This constraint means that our price variable must be greater than 0.
competition_lower_bound : This constraint means that our price variable must be greater than the competition price. Here we use a binary constraint, because we are constraining our variable (price) against another column (Competition_price).
competition_upper_bound : This constraint means that our price variable must be lesser than the competition price plus 30% (Competition_upper_bound_price).
For example, a very simple initial configuration might be as follows:
You are now ready to launch a pipeline run.
Then, click on the pipeline you have just created. This redirects you to the pipeline runs page. You can create a new run by clicking on "New", and specifying which dataset is used as input to the optimisation.
You can click on Pipeline>Predictions, then on the prediction of your pipeline. In the top-right, you can then choose to download the prediction file (as a CSV), or export it to an existing DataSource.
In our example, we obtain the following results:
Vehicle A
1J
38
49
49
Vehicle A
7J
37
48
48
Vehicle A
14J
34
44
44
Vehicle B
1J
39
51
51
Vehicle B
7J
36
47
47
Vehicle B
14J
33
43
43
Vehicle C
1J
41
53
53
Vehicle C
7J
38
49
49
Vehicle C
14J
37
48
48
The results are consistent with our configuration: the price of vehicles is maximised, while respecting the min and max bounds.
However, for 7J duration, vehicle A is more expensive than vehicle B. This is not possible in our case, as we want the prices of the vehicles to increase (the price of vehicle A must be lower than the price of vehicle B, which must be lower than the price of vehicle C).
Let’s add a new constraint in the following section.
We want to add an additional constraint to our example, to order the prices of vehicles A, B and C for each rental period (Duration). We want that the car prices must be at least €1 apart in the following order: Vehicle A, B, C.
To do this, we define the category_constraint :
For each rental period :
Indeed, order constraints can be written mathematically as follows:$variable(lesserorder) <= variable(greaterorder) * factor + delta$
The configuration then looks like this:
We obtain the following results :
Vehicle A
1J
38
49
49
Vehicle A
7J
37
48
46
Vehicle A
14J
34
44
42
Vehicle B
1J
39
51
51
Vehicle B
7J
36
47
47
Vehicle B
14J
33
43
43
Vehicle C
1J
41
53
53
Vehicle C
7J
38
49
49
Vehicle C
14J
37
48
48
The results here are more consistent : Depending on the rental period, the prices of vehicles A, B and C increase in this order.
First, you need to create a pipeline on the platform. In the Pipelines section, create a new Optimization pipeline.
Let's say we want to optimise the promotions applied to a shop's products. We need to determine the optimal discount percentage for each of our products, between 10% and 50% off.
First, the Verteego platform simulated all possible scenarios: for each of our products and each percentage reduction, the platform predicted the quantities sold (Forecasting module).
5 901 234 124 021
Alimentation
Lait et produits laitiers
MIKO
MECA_01
0.1
5.49
3.66
1537
8438.13
2812.71
5 901 234 124 021
Alimentation
Lait et produits laitiers
MIKO
MECA_02
0.2
4.88
3.66
2714
13244.32
3311.08
5 901 234 124 021
Alimentation
Lait et produits laitiers
MIKO
MECA_03
0.3
4.27
3.66
3095
13215.65
1887.95
Now we can use these scenarios to choose the best promotion mechanics to apply to our products (Optimization module).
In our example, we have 12 products and 5 promotion mechanisms, so the system has 60 rows.
You need to upload your system dataset on the platform :
Once your system dataset has been uploaded and validated on the platform, you need to create the configuration file.
You need to set up the initial configuration of your optimisation pipeline.
As explained in the previous section, you need to fill in everything relating to the variables :
variables : In this example, we want to optimize the variable select_best_promo_meca. We want this variable to be equal to 0 or 1, in order to select the right scenarios. The rows where the variable is equal to 1 will be the rows selected by the optimisation.
variable_types : In this example, we want integer or bool.
variable_keys : In this example, the variable best_promo_meca is indexed by a product and a promotional mechanism.
Then you need to determine the objective of the optimisation :
objective_method : In this example, we want to maximize the margin.
weighted_objective_columns : column(s) used as the optimisation objective. In this example, it is the margin and the variable select_best_promo_meca. Indeed, the objective can be written as :
Afterwards, you need to define the set of constraints :
unique: This constraint means that a product can only have one promotional mechanism. For each product, the sum of the variable best_promo_meca must be equal to 1. Given that the type of this variable is int or bool, this means that select_best_promo_meca can be equal to 0 or 1.
For example, a very simple initial configuration might be as follows:
You are now ready to launch a pipeline run.
In our example, we obtain the following results:
5 901 234 124 021
Alimentation
Lait et produits laitiers
MIKO
MECA_02
0.2
4.88
3.66
2714
13244.32
3311.08
1
5 901 234 124 022
Alimentation
Lait et produits laitiers
LA FROMAGERIE DU QUERCY
MECA_01
0.1
14.94
11.2
1393
20811.42
5209.82
1
5 901 234 124 028
Alimentation
Lait et produits laitiers
ARGEL
MECA_01
0.1
10.35
10.18
786
8135.1
133.62
1
5 901 234 124 043
Alimentation
Lait et produits laitiers
MONOPRIX GOURMET
MECA_01
0.1
10.35
8.1
2424
25088.4
5454.0
1
5 901 234 124 047
Alimentation
Lait et produits laitiers
PILPA
MECA_02
0.2
15.12
7.57
2508
37920.96
18935.4
1
5 901 234 124 053
Alimentation
Lait et produits laitiers
CARRE DES PINS
MECA_01
0.1
17.28
12.3
2465
42595.2
12275.7
1
5 901 234 124 020
Alimentation
Fruits et légumes
NOTRE JARDIN
MECA_02
0.2
9.28
8.6
4616
42836.48
3138.88
1
5 901 234 124 040
Alimentation
Fruits et légumes
MONOPRIX BIO
MECA_01
0.1
14.31
12.09
4578
65511.18
10163.16
1
5 901 234 124 042
Alimentation
Fruits et légumes
SANS MARQUE
MECA_01
0.1
13.32
9.78
4677
62297.64
16556.58
1
5 901 234 124 066
Alimentation
Fruits et légumes
BINS DE FRAICHEUR
MECA_02
0.2
4.08
2.8
4635
18910.8
5932.8
1
5 901 234 124 153
Alimentation
Fruits et légumes
LES HERBES DE MON PERE
MECA_01
0.1
9.81
5.5
4675
45861.75
20149.25
1
5 901 234 124 191
Alimentation
Fruits et légumes
BIO VILLAGE
MECA_02
0.2
13.6
8.9
5741
78077.6
26982.7
1
In this case, the optimization has selected the right promotional mechanism to maximise the margin. The output is 12 rows, 1 for each product, with the associated promotional mechanism.
Now let's add some constraints.
Let’s say we want to have at least 2 promotional mechanics at 40% off.
To do so, we add an aggregation constraint nb_meca_04.
We obtain the following results:
5 901 234 124 021
Alimentation
Lait et produits laitiers
MIKO
MECA_04
0.4
3.66
3.66
3200
11712.0
-3.2685e-11
1
5 901 234 124 022
Alimentation
Lait et produits laitiers
LA FROMAGERIE DU QUERCY
MECA_01
0.1
14.94
11.2
1393
20811.42
5209.82
1
5 901 234 124 028
Alimentation
Lait et produits laitiers
ARGEL
MECA_01
0.1
10.35
10.18
786
8135.1
133.62
1
5 901 234 124 043
Alimentation
Lait et produits laitiers
MONOPRIX GOURMET
MECA_01
0.1
10.35
8.1
2424
25088.4
5454.0
1
5 901 234 124 047
Alimentation
Lait et produits laitiers
PILPA
MECA_02
0.2
15.12
7.57
2508
37920.96
18935.4
1
5 901 234 124 053
Alimentation
Lait et produits laitiers
CARRE DES PINS
MECA_01
0.1
17.28
12.3
2465
42595.2
12275.7
1
5 901 234 124 020
Alimentation
Fruits et légumes
NOTRE JARDIN
MECA_02
0.2
9.28
8.6
4616
42836.48
3138.88
1
5 901 234 124 040
Alimentation
Fruits et légumes
MONOPRIX BIO
MECA_01
0.1
14.31
12.09
4578
65511.18
10163.16
1
5 901 234 124 042
Alimentation
Fruits et légumes
SANS MARQUE
MECA_01
0.1
13.32
9.78
4677
62297.64
16556.58
1
5 901 234 124 066
Alimentation
Fruits et légumes
BINS DE FRAICHEUR
MECA_04
0.4
3.06
2.8
6315
19323.9
1641.9
1
5 901 234 124 153
Alimentation
Fruits et légumes
LES HERBES DE MON PERE
MECA_01
0.1
9.81
5.5
4675
45861.75
20149.25
1
5 901 234 124 191
Alimentation
Fruits et légumes
BIO VILLAGE
MECA_02
0.2
13.6
8.9
5741
78077.6
26982.7
1