smac.utils.io.input_reader module

class smac.utils.io.input_reader.InputReader[source]

Bases: object

Reading all input files for SMAC (scenario file, instance files, …)

Note: Most of this code was taken from the pysmac repository.
We copy it here because we don’t want smac3 to depend on an earlier version!
read_instance_features_file(fn: str)[source]

Encapsulates read_instances_file of pysmac

Parameters:fn (string) – File name of instance feature file
Returns:features – first entry is a list of the feature names, second one is a dict with ‘instance name’ - ‘numpy array containing the features’ key-value pairs
Return type:tuple
read_instance_file(fn: str)[source]

Encapsulates read_instances_file of pysmac

Parameters:fn (string) – File name of instance file
Returns:instances – Each element is a list where the first element is the instance name followed by additional information for the specific instance.
Return type:list
read_pcs_file(fn: str)[source]

Encapsulates generating configuration space object

Parameters:fn (string) – File name of pcs file
Returns:ConfigSpace
Return type:ConfigSpace
read_scenario_file(fn: str)[source]

Encapsulates read_scenario_file of pysmac

Parameters:fn (string) – File name of scenario file
Returns:dict – (key, value) pairs are (variable name, variable value)
Return type:dictionary