Skip to content

Note

Click here to download the full example code

Basic ScoreCard

# mkdocs_gallery_thumbnail_path = 'images/example_thumnail.png'

import numpy as np

from krisi.evaluate import SampleTypes, ScoreCard

target, predictions = np.random.rand(1000), np.random.rand(1000)
sc = ScoreCard(
    target,
    predictions,
    model_name="<your_model_name>",
    dataset_name="<your_dataset_name>",
    sample_type=SampleTypes.insample,
)

""" A predefined metrics """
sc.evaluate(defaults=True)

""" Adding a new metric """
sc["own_metric"] = (target - predictions).mean()

""" Print scorecard summary """
sc.print("extended")

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

Download Python source code: scorecard_basic.py

Download Jupyter notebook: scorecard_basic.ipynb

Gallery generated by mkdocs-gallery