immuneML.ml_methods.util package

Submodules

immuneML.ml_methods.util.Util module

class immuneML.ml_methods.util.Util.Util[source]

Bases: object

static binarize_labels(true_y, predicted_y, labels)[source]

Binarizes the predictions in place using scikit-learn’s label_binarize() method

static get_immuneML_version()[source]
static make_binary_class_mapping(y) → dict[source]

Creates binary class mapping from a list of classes which can be strings, numbers or boolean values

Parameters

y – list of classes per example, as supplied to fit() method of the classifier; it should include all classes that will appear in the data

Returns

mapping dictionary where 0 and 1 are always the keys and the values are original class names which were mapped for these values

static make_class_mapping(y) → dict[source]

Creates a class mapping from a list of classes which can be strings, numbers of booleans; maps to same name in multi-class settings

static map_to_new_class_values(y, class_mapping: dict)[source]
static map_to_old_class_values(y, class_mapping: dict)[source]
static setup_pytorch(number_of_threads, random_seed)[source]

Module contents