immuneML.ml_methods.util package
Submodules
immuneML.ml_methods.util.Util module
- class immuneML.ml_methods.util.Util.Util[source]
Bases:
object
- static binarize_label_classes(true_y, predicted_y, classes)[source]
Binarizes the predictions in place using scikit-learn’s label_binarize() method
Necessary for some sklearn metrics, like roc_auc_score
- static make_binary_class_mapping(y, positive_class=None) 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