Skip to content

Note

Click here to download the full example code

Classification with multiple labels and probabilities

# mkdocs_gallery_thumbnail_path = 'images/example_thumnail.png'


from krisi import library, score
from krisi.utils.data import generate_random_classification

y, preds, probs, sample_weight = generate_random_classification(
    num_labels=5, num_samples=1000
)
score(
    y=y,
    predictions=preds,
    probabilities=probs,
    # dataset_type="classification_multilabel", # if automatic inference of dataset type fails
    calculation="single",
    default_metrics=library.ClassificationRegistry().multiclass_classification_metrics,
).print()

Total running time of the script: ( 0 minutes 0.000 seconds)

Download Python source code: evaluate_classification_multilabel.py

Download Jupyter notebook: evaluate_classification_multilabel.ipynb

Gallery generated by mkdocs-gallery