cleverly.estimators.dose_response.DoseResponseScoreReport#

class cleverly.estimators.dose_response.DoseResponseScoreReport(names: tuple[str, ...], scores: NDArray[float64], std_errors: NDArray[float64], threshold: float, tolerance: float, backend: str | None = None)[source]#

Each pair’s fluctuation score against the package’s score threshold.

The score is the mean weighted score of the pair’s fluctuation at its solution, on the scaled outcome. The threshold is score_threshold() at the largest finite scaled standard error of the pairs. The fit refuses a pair whose fluctuation did not solve its score to about 1e-6 * sd / sqrt(n), against a threshold of about 1e-3 * sd / n, so below about a million rows a stored fit passes and the report restates convergence.

Parameters:
namestuple of str

The pairs, in report order.

scoresndarray

Each pair’s score on the scaled outcome.

std_errorsndarray

Each pair’s plug-in standard error, divided by the outcome scaler’s range.

thresholdfloat

The magnitude a score may reach and pass.

tolerancefloat

The relative tolerance of the threshold.

backendstr or None

The dataframe library to_frame() returns by default.

Methods#

DoseResponseScoreReport.to_frame(backend: str | None = None) → Any[source]#

One row per pair: its score, scaled standard error, ratio and verdict.

Parameters:
backendstr or None

The dataframe library, or None for the fit’s.

Returns:
DataFrame

Columns name, score, scaled_std_error, ratio, threshold and passed.

Attributes#

DoseResponseScoreReport.backend: str | None = None#
DoseResponseScoreReport.passed#

Whether every pair’s score is within the threshold.

DoseResponseScoreReport.ratios#

Each pair’s abs(score) / threshold.

DoseResponseScoreReport.names: tuple[str, ...]#
DoseResponseScoreReport.scores: NDArray[float64]#
DoseResponseScoreReport.std_errors: NDArray[float64]#
DoseResponseScoreReport.threshold: float#
DoseResponseScoreReport.tolerance: float#