qsprpred.benchmarks.settings package

Submodules

qsprpred.benchmarks.settings.benchmark module

class qsprpred.benchmarks.settings.benchmark.BenchmarkSettings(name: str, n_replicas: int, random_seed: int, data_sources: list[DataSource], descriptors: list[list[DescriptorSet]], target_props: list[list[TargetSpec]], pipelines: list[DatasetPipeline], models: list[QSPRModel], assessors: list[ModelAssessor], subsets: dict[str, tuple[DataSplit, str, int]] = (), optimizers: list[HyperparameterOptimization] = ())[source]

Bases: JSONSerializable

Class that determines settings for a benchmarking run.

Variables:
  • name (str) – Name of the benchmarking run.

  • n_replicas (int) – Number of replicas to run.

  • random_seed (int) – Random seed to use.

  • data_sources (list[DataSource]) – Data sources to use.

  • descriptors (list[list[DescriptorSet]]) – Descriptor sets to use.

  • target_props (list[list[TargetProperty]]) – Target properties to use.

  • prep_settings (list[DatasetPipeline]) – Data preparation settings to use.

  • models (list[QSPRModel]) – Models to use.

  • assessors (list[ModelAssessor]) – Model assessors to use.

  • subsets (dict[str, tuple[DataSplit, str, int]]) – Dictionary mapping assessor names to tuples of data split, set (Train/Test), and fold index. Used to apply assessors to subsets of the data.

  • optimizers (list[HyperparameterOptimization]) – Hyperparameter optimizers to use.

assessors: list[ModelAssessor]
checkConsistency()[source]

Checks if the settings are consistent.

Raises:

AssertionError – If the settings are inconsistent.

data_sources: list[DataSource]
descriptors: list[list[DescriptorSet]]
classmethod fromFile(filename: str) Any

Initialize a new instance from a JSON file.

Parameters:

filename (str) – path to the JSON file

Returns:

new instance of the class

Return type:

instance (object)

classmethod fromJSON(json: str) Any

Reconstruct object from a JSON string.

Parameters:

json (str) – JSON string of the object

Returns:

reconstructed object

Return type:

obj (object)

models: list[QSPRModel]
n_replicas: int
name: str
optimizers: list[HyperparameterOptimization] = ()
pipelines: list[DatasetPipeline]
random_seed: int
subsets: dict[str, tuple[DataSplit, str, int]] = ()
target_props: list[list[TargetSpec]]
toFile(filename: str) str

Serialize object to a JSON file. This JSON file should contain all data necessary to reconstruct the object.

Parameters:

filename (str) – filename to save object to

Returns:

absolute path to the saved JSON file of the object

Return type:

filename (str)

toJSON() str
Serialize object to a JSON string. This JSON string should

contain all data necessary to reconstruct the object.

Returns:

JSON string of the object

Return type:

json (str)

Module contents