Limpiar los avisos de estilo
This commit is contained in:
@@ -68,7 +68,9 @@ def hpv_missing_as_the_current_platform_read_it(events: pd.DataFrame) -> pd.Data
|
||||
near = days(prepared(events)).between(0, cacu.INDEX_SAMPLE_DAYS)
|
||||
has = events[(events["type"] == "hpv") & near]
|
||||
missing = index[~index["person_id"].isin(has["person_id"])]
|
||||
assumed = missing.assign(date=missing["index_date"], type="hpv", value_code="assumed") # not positive, and not a negative visit
|
||||
assumed = missing.assign(
|
||||
date=missing["index_date"], type="hpv", value_code="assumed"
|
||||
) # not positive, and not a negative visit
|
||||
return pd.concat([events, assumed[events.columns]], ignore_index=True)
|
||||
|
||||
|
||||
@@ -100,8 +102,9 @@ def test_predictions_match_the_current_models(name):
|
||||
# Older reference intervals include non-estimable covariance estimates. Preserve
|
||||
# parity for point estimates and for intervals that remain estimable.
|
||||
comparable = both[ours].notna() if ours != "probability" else np.ones(len(both), bool)
|
||||
np.testing.assert_allclose(both.loc[comparable, ours], both.loc[comparable, theirs],
|
||||
rtol=RTOL, atol=0)
|
||||
np.testing.assert_allclose(
|
||||
both.loc[comparable, ours], both.loc[comparable, theirs], rtol=RTOL, atol=0
|
||||
)
|
||||
if spec.method != "logistic regression":
|
||||
assert (pd.to_datetime(both["index_date"]) == pd.to_datetime(both["fecha_indice"])).all()
|
||||
|
||||
@@ -128,7 +131,7 @@ def test_survival_matches_the_current_model_and_publishes_patient_scenarios(monk
|
||||
"stack_w_lr_36m", "stack_w_lr_60m"): # fmt: skip
|
||||
assert metrics[name] == pytest.approx(current["metrics"][name], rel=RTOL), name
|
||||
found = spec.predict(model, events)
|
||||
assert all(set(json.loads(value)) == set(spec.features) for value in found['input_values'])
|
||||
assert all(set(json.loads(value)) == set(spec.features) for value in found["input_values"])
|
||||
reference = pd.read_parquet(REFERENCE / "ref" / "survival.parquet")
|
||||
both = found.merge(reference, left_on=["person_id", "horizon_years"],
|
||||
right_on=["pac_id", "horizonte_anios"], validate="1:1") # fmt: skip
|
||||
|
||||
Reference in New Issue
Block a user