Performs ablation between two configurations (from source to target).
Source:R/ablation.R
ablation.Rd
Ablation is a method for analyzing the differences between two configurations.
Usage
ablation(
iraceResults,
src = 1L,
target = NULL,
ab_params = NULL,
type = c("full", "racing"),
nrep = 1L,
seed = 1234567L,
ablationLogFile = "log-ablation.Rdata",
instancesFile = "train",
...
)
Arguments
- iraceResults
list()
|character(1)
Object created by irace and typically saved in the log fileirace.Rdata
. If a character string is given, then it is interpreted as the path to the log file from which theiraceResults
object will be loaded.- src, target
integer(1)|character(1)
Source and target configuration IDs. By default, the first configuration ever evaluated (ID 1) is used assrc
and the best configuration found by irace is used as target. If the argument is a string, it is interpreted as the path to a file, with the format specified byreadConfigurationsFile()
, that contains the configuration.- ab_params
character()
Specific parameter names to be used for the ablation. They must be inparameters$names
. By default, use all parameters.- type
"full"|"racing"
Type of ablation to perform:"full"
will execute each configuration on alln_instances
to determine the best-performing one;"racing"
will apply racing to find the best configurations.- nrep
integer(1)
Number of replications per instance used in"full"
ablation. Whennrep > 1
, each configuration will be executednrep
times on each instance with different random seeds.- seed
integer(1)
Integer value to use as seed for the random number generation.- ablationLogFile
character(1)
Log file to save the ablation log. IfNULL
, the results are not saved to a file.- instancesFile
character(1)
Instances file used for ablation:'train'
,'test'
or a filename containing the list of instances.- ...
Further arguments to override scenario settings, e.g.,
debugLevel
,parallel
, etc.
Value
A list containing the following elements:
- configurations
Configurations tested in the ablation.
- instances
A matrix with the instances used in the experiments. First column has the instances IDs from
iraceResults$scenario$instances
, second column the seed assigned to the instance.- experiments
A matrix with the results of the experiments (columns are configurations, rows are instances).
- scenario
Scenario object with the settings used for the experiments.
- trajectory
IDs of the best configurations at each step of the ablation.
- best
Best configuration found in the experiments.
References
C. Fawcett and H. H. Hoos. Analysing differences between algorithm configurations through ablation. Journal of Heuristics, 22(4):431–458, 2016.
Examples
# \donttest{
logfile <- system.file(package="irace", "exdata", "sann.rda")
# Execute ablation between the first and the best configuration found by irace.
ablog <- ablation(logfile, ablationLogFile = NULL)
#> # Using 'train' instances:
#> 0.884005369853146
#> 0.880947100031069
#> 0.904681888192063
#> 0.900163114334115
#> 0.866633529079988
#> 0.880708258328042
#> 0.906742637961832
#> 0.909547405641143
#> 0.915498479696396
#> 0.883415421929479
#> 0.903675108477822
#> 0.885012731632937
#> 0.869148855041432
#> 0.900580009728795
#> 0.927152920544459
#> 0.917793904675059
#> 0.882968846873946
#> 0.885798769736117
#> 0.90210318705864
#> 0.868509411416815
#> 0.922540360084428
#> 0.911227699158646
#> 0.872788234884158
#> 0.870599426173864
#> 0.908322348521657
#> 0.922639570237068
#> 0.913237966221797
#> 0.910351134533832
#> 0.922299418067624
#> 0.899828346428394
#> 0.916750217414544
#> 0.905476806750527
#> 0.896849728585988
#> 0.894640732980235
#> 0.890137846625355
#> 0.888869020843127
#> 0.884053454324617
#> 0.863826663914102
#> 0.898754153252737
#> 0.91625064748894
#> 0.887185906190741
#> 0.881934986431331
#> 0.921907878731671
#> 0.875746111301873
#> 0.888003316398042
#> 0.895470873149715
#> 0.890172060164641
#> 0.920807695887555
#> 0.856600773136733
#> 0.879800034895522
#> # 2024-12-25 22:35:16 UTC: Starting ablation from 1 to 144
#> # Seed: 1234567
#> # Source configuration (row number is ID):
#> tmax temp
#> 1 2239 9.9209
#> # Target configuration (row number is ID):
#> tmax temp
#> 144 1578 58.1816
#> # 2024-12-25 22:35:16 UTC: Executing source and target configurations on the given instances * nrep (50)...
#> # Generating configurations (row number is ID): tmax temp
#> tmax temp
#> 2 1578 9.9209
#> 3 2239 58.1816
#> # 2024-12-25 22:35:18 UTC: Ablation (full) of 2 configurations on 50 instances.
#> # Markers:
#> x No test is performed.
#> c Configurations are discarded only due to capping.
#> - The test is performed and some configurations are discarded.
#> = The test is performed but no configuration is discarded.
#> ! The test is performed and configurations could be discarded but elite configurations are preserved.
#> . All alive configurations are elite and nothing is discarded.
#>
#> +-+-----------+-----------+-----------+----------------+-----------+--------+-----+----+------+
#> | | Instance| Alive| Best| Mean best| Exp so far| W time| rho|KenW| Qvar|
#> +-+-----------+-----------+-----------+----------------+-----------+--------+-----+----+------+
#> # 2024-12-25 22:35:18 UTC: Saving recovery info.
#> |x| 1| 2| 3| 0.4144861905| 2|00:00:00| NA| NA| NA|
#> |x| 2| 2| 3| 2.051339761| 4|00:00:00|+1.00|1.00|0.0000|
#> |x| 3| 2| 3| 1.670239380| 6|00:00:00|+1.00|1.00|0.0000|
#> |x| 4| 2| 3| 1.268806630| 8|00:00:00|+1.00|1.00|0.0000|
#> |x| 5| 2| 3| 1.598137028| 10|00:00:00|+0.20|0.36|0.4000|
#> |x| 6| 2| 3| 1.668465978| 12|00:00:00|-0.07|0.11|0.5333|
#> |x| 7| 2| 3| 1.516492158| 14|00:00:00|+0.05|0.18|0.4762|
#> |x| 8| 2| 3| 1.388169534| 16|00:00:00|+0.14|0.25|0.4286|
#> |x| 9| 2| 3| 1.242651329| 18|00:00:00|+0.22|0.31|0.3889|
#> |x| 10| 2| 3| 1.368636354| 20|00:00:00|+0.07|0.16|0.4667|
#> |x| 11| 2| 3| 1.250079023| 22|00:00:00|+0.13|0.21|0.4364|
#> |x| 12| 2| 3| 1.160050632| 24|00:00:00|+0.18|0.25|0.4091|
#> |x| 13| 2| 3| 1.077201852| 26|00:00:00|+0.23|0.29|0.3846|
#> |x| 14| 2| 3| 1.029474458| 28|00:00:00|+0.12|0.18|0.4396|
#> |x| 15| 2| 3| 0.9937500799| 30|00:00:00|+0.16|0.22|0.4190|
#> |x| 16| 2| 3| 1.183005439| 32|00:00:00|+0.08|0.14|0.4583|
#> |x| 17| 2| 3| 1.115067685| 34|00:00:00|+0.12|0.17|0.4412|
#> |x| 18| 2| 3| 1.053442404| 36|00:00:00|+0.15|0.20|0.4248|
#> |x| 19| 2| 3| 1.037666373| 38|00:00:00|+0.18|0.22|0.4094|
#> |x| 20| 2| 3| 0.9984607852| 40|00:00:00|+0.21|0.25|0.3947|
#> |x| 21| 2| 3| 1.092300447| 42|00:00:00|+0.14|0.18|0.4286|
#> |x| 22| 2| 3| 1.056020065| 44|00:00:00|+0.17|0.21|0.4156|
#> |x| 23| 2| 3| 1.014969081| 46|00:00:00|+0.19|0.23|0.4032|
#> |x| 24| 2| 3| 1.097397363| 48|00:00:00|+0.14|0.17|0.4312|
#> |x| 25| 2| 3| 1.063546836| 50|00:00:00|+0.16|0.19|0.4200|
#> |x| 26| 2| 3| 1.145654800| 52|00:00:00|+0.11|0.15|0.4431|
#> |x| 27| 2| 3| 1.111023389| 54|00:00:00|+0.13|0.17|0.4330|
#> |x| 28| 2| 3| 1.085119090| 56|00:00:00|+0.15|0.18|0.4233|
#> |x| 29| 2| 3| 1.076124894| 58|00:00:00|+0.11|0.14|0.4433|
#> |x| 30| 2| 3| 1.073574308| 60|00:00:00|+0.08|0.11|0.4598|
#> |x| 31| 2| 3| 1.133967415| 62|00:00:00|+0.10|0.13|0.4516|
#> |x| 32| 2| 3| 1.101966817| 64|00:00:00|+0.07|0.10|0.4657|
#> |x| 33| 2| 3| 1.075606123| 66|00:00:00|+0.08|0.11|0.4583|
#> |x| 34| 2| 3| 1.076402899| 68|00:00:00|+0.06|0.09|0.4706|
#> |x| 35| 2| 3| 1.056554310| 70|00:00:00|+0.04|0.07|0.4807|
#> |x| 36| 2| 3| 1.037171365| 72|00:00:00|+0.05|0.08|0.4746|
#> |x| 37| 2| 3| 1.010144107| 74|00:00:00|+0.06|0.09|0.4685|
#> |x| 38| 2| 3| 1.017279092| 76|00:00:00|+0.08|0.10|0.4623|
#> |x| 39| 2| 3| 1.005066906| 78|00:00:00|+0.09|0.11|0.4561|
#> |x| 40| 2| 3| 0.9863916316| 80|00:00:00|+0.10|0.12|0.4500|
#> |x| 41| 2| 3| 0.9651195377| 82|00:00:00|+0.11|0.13|0.4439|
#> |x| 42| 2| 3| 1.038340738| 84|00:00:00|+0.09|0.11|0.4553|
#> |x| 43| 2| 3| 1.023070443| 86|00:00:00|+0.07|0.09|0.4651|
#> |x| 44| 2| 3| 1.009276374| 88|00:00:00|+0.08|0.10|0.4598|
#> |x| 45| 2| 3| 0.9950711132| 90|00:00:00|+0.09|0.11|0.4545|
#> |x| 46| 2| 3| 0.9825379424| 92|00:00:00|+0.10|0.12|0.4493|
#> |x| 47| 2| 3| 1.028561902| 94|00:00:00|+0.11|0.13|0.4440|
#> |x| 48| 2| 3| 1.082203870| 96|00:00:00|+0.12|0.14|0.4388|
#> |x| 49| 2| 3| 1.068642830| 98|00:00:00|+0.13|0.15|0.4337|
#> |-| 50| 1| 3| 1.105663789| 100|00:00:00| NA| NA| NA|
#> +-+-----------+-----------+-----------+----------------+-----------+--------+-----+----+------+
#> Best-so-far configuration: 3 mean value: 1.105663789
#> Description of the best-so-far configuration:
#> .ID. tmax temp .PARENT.
#> 3 3 2239 58.1816 1
#>
#> # Best changed parameters:
#> # temp : 9.9209 -> 58.1816
#> # 2024-12-25 22:35:20 UTC: Final best configuration:
#> tmax temp
#> 3 2239 58.1816
plotAblation(ablog)
# Execute ablation between two selected configurations, and selecting only a
# subset of parameters, directly reading the setup from the irace log file.
ablog <- ablation(logfile, src = 1, target = 10,
ab_params = c("temp"), ablationLogFile = NULL)
#> # Using 'train' instances:
#> 0.884005369853146
#> 0.880947100031069
#> 0.904681888192063
#> 0.900163114334115
#> 0.866633529079988
#> 0.880708258328042
#> 0.906742637961832
#> 0.909547405641143
#> 0.915498479696396
#> 0.883415421929479
#> 0.903675108477822
#> 0.885012731632937
#> 0.869148855041432
#> 0.900580009728795
#> 0.927152920544459
#> 0.917793904675059
#> 0.882968846873946
#> 0.885798769736117
#> 0.90210318705864
#> 0.868509411416815
#> 0.922540360084428
#> 0.911227699158646
#> 0.872788234884158
#> 0.870599426173864
#> 0.908322348521657
#> 0.922639570237068
#> 0.913237966221797
#> 0.910351134533832
#> 0.922299418067624
#> 0.899828346428394
#> 0.916750217414544
#> 0.905476806750527
#> 0.896849728585988
#> 0.894640732980235
#> 0.890137846625355
#> 0.888869020843127
#> 0.884053454324617
#> 0.863826663914102
#> 0.898754153252737
#> 0.91625064748894
#> 0.887185906190741
#> 0.881934986431331
#> 0.921907878731671
#> 0.875746111301873
#> 0.888003316398042
#> 0.895470873149715
#> 0.890172060164641
#> 0.920807695887555
#> 0.856600773136733
#> 0.879800034895522
#> # 2024-12-25 22:35:20 UTC: Starting ablation from 1 to 10
#> # Seed: 1234567
#> # Source configuration (row number is ID):
#> tmax temp
#> 1 2239 9.9209
#> # Target configuration (row number is ID):
#> tmax temp
#> 10 3176 66.1709
#> # 2024-12-25 22:35:21 UTC: Executing source and target configurations on the given instances * nrep (50)...
#> # 2024-12-25 22:35:23 UTC: Final best configuration:
#> tmax temp
#> 1 2239 9.9209
plotAblation(ablog)
# }