compare#

skore.compare(reports, *, n_jobs=None)[source]#

Consolidate reports into a single ComparisonReport.

Parameters:
reportslist of reports or dict

Reports to compare. If a dict, keys will be used to label the estimators; if a list, the labels are computed from the estimator class names. Expects at least two reports to compare, with the same test target.

n_jobsint, default=None

Number of jobs to run in parallel. Training the estimators and computing the scores are parallelized. When accessing some methods of the ComparisonReport, the n_jobs parameter is used to parallelize the computation. None means 1 unless in a joblib.parallel_backend context. -1 means using all processors.

Returns:
ComparisonReport

A comparison report containing the reports to compare.

Examples

>>> from sklearn.datasets import load_breast_cancer
>>> from sklearn.linear_model import LogisticRegression
>>> from skore import evaluate, compare
>>> X, y = load_breast_cancer(return_X_y=True)
>>> estimator_1 = LogisticRegression()
>>> estimator_2 = LogisticRegression(C=2)
>>> report_1 = evaluate(estimator_1, X, y, pos_label=1, splitter=0.2)
>>> report_2 = evaluate(estimator_2, X, y, pos_label=1, splitter=0.2)
>>> report = compare([report_1, report_2])