cleverly.effect_curves.ScoreAssessment#

class cleverly.effect_curves.ScoreAssessment(column: str, scale: str, estimates: dict[str, ParameterEstimate], status: str, status_reason: str, span: dict[str, float], compare: str | None = None, compared: ScoreAssessment | None = None, backend: str = 'pandas')[source]#

The risk difference and calibration of a fixed external score, with intervals.

With compare=, it also holds the second score’s parameters and the paired risk difference of the two, all from one targeted fit.

Parameters:
columnstr

The score column.

scale{“difference”, “log_ratio”}

The scale the score predicts.

estimatesdict of str to ParameterEstimate

risk_difference, calibration[(intercept)] and calibration[<column>], and with compare= the paired row risk_difference[<column> - <compare>], the risk of column minus that of compare: negative when column predicts better.

status{“supported”, “experimental”}

The worst support label of the estimates, those of compared included.

status_reasonstr

The reasons for an experimental status, joined by "; "; empty otherwise.

spandict of str to float

The fluctuation’s span record: columns, rank, out_of_span, score_norm and reduced, the number of thinnest directions a log-ratio fit dropped to settle (0 on the full span).

comparestr or None

The second score column, or None.

comparedScoreAssessment or None

The three parameters of compare, from the same fluctuation, or None.

backendstr

The dataframe backend of the study’s data.

Methods#

ScoreAssessment.rows() → list[tuple[str, str, ParameterEstimate]][source]#

Every estimate with the score it describes, in report order.

Returns:
list of tuple

(score, name, estimate): the column’s three parameters, then those of compare, then the paired row, whose score is "<column> - <compare>".

ScoreAssessment.summary(*, detail: Literal['short', 'full'] = 'short') → Any[source]#

A printable report of the check.

Parameters:
detail{“short”, “full”}

"full" adds the p-value of each estimate and the fluctuation’s span record.

Returns:
Summary

The report.

ScoreAssessment.to_frame() → Any[source]#

One row per parameter, in the study’s backend.

Returns:
dataframe

A score column (the column, compare, or "<column> - <compare>") and each estimate’s fields (ParameterEstimate.to_dict()), in the order of rows(). support and support_reason carry each row’s status.

Attributes#

ScoreAssessment.backend: str = 'pandas'#
ScoreAssessment.compare: str | None = None#
ScoreAssessment.compared: ScoreAssessment | None = None#
ScoreAssessment.paired_name#

The key of the paired row in estimates, or None without compare=.

ScoreAssessment.column: str#
ScoreAssessment.scale: str#
ScoreAssessment.estimates: dict[str, ParameterEstimate]#
ScoreAssessment.status: str#
ScoreAssessment.status_reason: str#
ScoreAssessment.span: dict[str, float]#