Skip to content

Commit

Permalink
add model performance to dichotomous risks
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengp0 committed Feb 15, 2024
1 parent f5540af commit 214e4b1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/bopforge/dichotomous_pipeline/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from mrtool import MRBRT, CovFinder, LinearCovModel, MRData
from pandas import DataFrame
from scipy.stats import norm
from limetr import get_aic, get_bic, get_rmse


def get_signal_model(settings: dict, df: DataFrame) -> MRBRT:
Expand Down Expand Up @@ -257,6 +258,14 @@ def get_linear_model_summary(
summary["pub_bias"] = int(pval < 0.05)
summary["pub_bias_pval"] = float(pval)

summary["model_performance"] = {
"linear_model": {
"aic": float(get_aic(linear_model.lt)),
"bic": float(get_bic(linear_model.lt)),
"rmse": float(get_rmse(linear_model.lt)),
}
}

return summary


Expand Down

0 comments on commit 214e4b1

Please sign in to comment.