Skip to content

Note

Click here to download the full example code

Classification with Probabilities

# mkdocs_gallery_thumbnail_path = 'images/example_thumnail.png'


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

y, preds, probs, sample_weight = generate_random_classification(
    num_labels=2, num_samples=1000
)
sc = score(
    y=y,
    predictions=preds,
    probabilities=probs,
    # dataset_type="classification_binary_balanced", # if automatic inference of dataset type fails
    calculation="single",
)
sc.print()

sc = score(
    y=y,
    predictions=preds,
    probabilities=probs,
    # dataset_type="classification_binary_balanced", # if automatic inference of dataset type fails
    calculation="both",
)
sc.print()
sc.generate_report()

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

Download Python source code: evaluate_classification_with_probabilities.py

Download Jupyter notebook: evaluate_classification_with_probabilities.ipynb

Gallery generated by mkdocs-gallery