Learn R Programming

irace (version 3.4.1)

irace2pyimp: Convert an irace.Rdata file into the format supported by PyImp

Description

This function converts an irace.Rdata file generated by irace into the input format supported by the parameter importance analysis tool PyImp (https://github.com/automl/ParameterImportance).

Usage

irace2pyimp(file = "./irace.Rdata", normalise = "none",
  outdir = "./pyimp-input/", instanceFeatureFile = NA,
  filterConditions = NA, defaultConfigurationID = 1,
  ignoreUnsupported = 0)

Arguments

file

(character(1))
Filename of the .Rdata file generated by irace after a tuning run is finished.

normalise

(none | instance | feature)
Normalise the cost metric values into [0, 1] range before converting to PyImp format. Possible values are:
* none (default): no normalisation.
* instance : normalisation is done per instance.
* feature : normalisation is based on features, i.e., instances with the same feature-vector values are grouped together and the normalised cost is calculated per group.

outdir

(character(1))
Directory where all generated files are stored.

instanceFeatureFile

(character(1))
A .csv file containing instance features (one line per instance, sorted in the same order as the list of instances input to irace). The first line contains feature names.

filterConditions

Only extract data that satisfies the given conditions. The conditions are in R expression format.

defaultConfigurationID

Index of default configuration (starting from 1), used by ablation analysis.

ignoreUnsupported

Forbidden configurations and repairConfiguration are not supported by the script. Set ignoreUnsupported=1 to ignore them and proceed with your own risk. This may cause some unwanted behaviours, e.g., forbidden configurations may appear in ablation analysis's path.

Author

Nguyen Dang and Manuel López-Ibáñez

Details

The generated files include:

  • params.pcs : a text file containing the parameter space definition.

  • runhistory.json : a JSON file containing the list of algorithm configurations evaluated during the tuning and the performance data obtained.

  • traj_aclib2.json : a JSON file containing the best configurations after each iteration of irace. The last configuration will be used as the target configuration in ablation analysis.

  • scenario.txt : a text file containing the definition of the tuning scenario.

  • instances.txt : a text file containing the list of instances.

  • features.csv : a text file containing instance features. If no instance features are provided, the index of each instance will be used as a feature.

Examples

Run this code
if (FALSE) {
irace2pyimp(file='irace.Rdata', outdir='pyimp-run')
irace2pyimp(file='irace.Rdata', normalise='feature',
            instanceFeatureFile='feature.csv', filterConditions="algorithm!='mas'")
}
cat("See more examples in '",
    file.path(system.file(package="irace"), "examples/irace2pyimp/acotsp/run.sh"),
    "' and in '",
    file.path(system.file(package="irace"), "examples/irace2pyimp/002-TemplateDesign/run.sh"),
    "'\n")

Run the code above in your browser using DataLab