chemicalchecker.tool.targetmate.evaluation.validation.Validation
- class Validation(splitter=None, is_cv=False, is_stratified=True, n_splits=3, test_size=0.2, explain=False, model_type=None, only_train=False, only_validation=True, **kwargs)[source]
Bases:
BaseValidation
,HPCUtils
Initialize validation class.
- Parameters:
splitter (object) – If none specified, the corresponding TargetMate splitter is used.
is_cv (bool) – If False, a simple train-test split is done.
is_stratified (bool) – Do stratified split.
n_splits (int) – Number of splits to perform.
explain (bool) – Calculate Shapley values for predictions.
test_size (float) – Proportion of samples in the test set.
is_tmp (bool) – Store all in temporary path
is_tmp_bases|signatures|predictions (bool) – Store bases|signatures|predictions in temporary path
Methods
as_dict
cpu_count
fit
Execute the any method on the configured HPC.
gather
get_splits
multi_validate
multi_validate_onlytrain
predict
save
score
setup
single_validate
Validate a TargetMate model using train-test splits.
Wait for jobs to finish
- 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.
- validate(tm, data, train_idx=None, test_idx=None, wipe=True, scramble=False, set_train_idx=None, set_test_idx=None)[source]
Validate a TargetMate model using train-test splits.
- Parameters:
tm (TargetMate model, or list of) – The TargetMate model to be evaluated. A list is accepted.
data (InputData, or list of) – Data object. A list is accepted.
train_idx (array) – Precomputed indices for the train set (default=None).
test_idx (array) – Precomputed indices for the test set (default=None).
wipe (bool) – Clean temporary directory once done (default=True).
only_validation (bool) – Only the validations files pkl and txt files are kept (default=True).
- waiter(jobs, secs=3)
Wait for jobs to finish