chemicalchecker.tool.targetmate.base.Model

class Model(is_classifier, **kwargs)[source]

Bases: ModelSetup

Generic model class

Initialize TargetMate model.

Parameters:

is_classifier (bool) – Is the model a classifier or a regressor?

Methods

array_on_disk

check_array_from_disk

compress_models

Store model in compressed format for persistance

cpu_count

create_models_path

directory_tree

explain

find_base_mod

Select a pipeline, for example, using HyperOpt.

fit

func_hpc

Execute the any method on the configured HPC.

load

Load previously stored TargetMate instance.

load_base_mod

Load base model

load_base_model

Load a base model

load_data

metric_calc

Calculate metric.

model_iterator

predict

prepare_data

prepare_for_ml

read_data

repath_bases_by_fold

Redefine path of a TargetMate instance.

repath_predictions_by_fold

Redefine path of a TargetMate instance.

repath_predictions_by_fold_and_set

repath_predictions_by_set

Redefine path of a TargetMate instance.

reset_path_bases

reset_path_predictions

Reset predictions path

sampler

save

Save TargetMate instance

save_data

waiter

Wait for jobs to finish

wipe

Delete temporary data

compress_models()

Store model in compressed format for persistance

find_base_mod(X, y, smiles, destination_dir)[source]

Select a pipeline, for example, using HyperOpt.

func_hpc(func_name, *args, **kwargs)

Execute the any method on the configured HPC.

Parameters:
  • args (tuple) – the arguments for of the function method

  • kwargs (dict) – arguments for the HPC method.

static load(models_path)

Load previously stored TargetMate instance.

load_base_mod()[source]

Load base model

load_base_model(destination_dir, append_pipe=False)

Load a base model

metric_calc(y_true, y_pred, metric=None)[source]

Calculate metric. Returns (value, weight) tuple.

repath_bases_by_fold(fold_number, is_tmp=True, reset=True, only_train=False)

Redefine path of a TargetMate instance. Used by the Validation class.

repath_predictions_by_fold(fold_number, is_tmp=True, reset=True)

Redefine path of a TargetMate instance. Used by the Validation class.

repath_predictions_by_set(is_train, is_tmp=True, reset=True)

Redefine path of a TargetMate instance. Used by the Validation class.

reset_path_predictions(is_tmp=True)

Reset predictions path

save()

Save TargetMate instance

waiter(jobs, secs=3)

Wait for jobs to finish

wipe()

Delete temporary data