Skip to content

Commit

Permalink
modified perf eval functions, upgraded to 0.1.8a1
Browse files Browse the repository at this point in the history
  • Loading branch information
lshpaner committed Jul 21, 2024
1 parent 523b7e1 commit b8b3e3d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="kfre",
version="0.1.8a",
version="0.1.8a1",
author="Leonid Shpaner",
author_email="lshpaner@ucla.edu",
description="A Python library for estimating kidney failure risk using the KFRE model developed by Tangri et al.",
Expand Down
10 changes: 5 additions & 5 deletions src/kfre/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.1.8a"
__version__ = "0.1.8a1"

from .main import *

Expand Down Expand Up @@ -61,8 +61,8 @@ def kfre_person(
"perform_conversions",
"add_kfre_risk_col",
"RiskPredictor",
"calculate_outcome",
"classify_ckd_stages",
"prep_and_plot_metrics_vars",
"calculate_metrics_for_n_var",
"calc_esrd_outcome",
"class_ckd_stages",
"plot_kfre_metrics",
"eval_kfre_metrics",
]
12 changes: 6 additions & 6 deletions src/kfre/perform_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
################################################################################


def calculate_outcome(df, col, years, duration_col, prefix=None):
def calc_esrd_outcome(df, col, years, duration_col, prefix=None):
"""Calculate outcome based on a given number of years.
This function creates a new column in the dataframe which is populated with
Expand Down Expand Up @@ -53,7 +53,7 @@ def calculate_outcome(df, col, years, duration_col, prefix=None):
################################################################################


def classify_ckd_stages(
def class_ckd_stages(
df,
egfr_col="eGFR",
stage_col=None,
Expand Down Expand Up @@ -95,7 +95,7 @@ def classify_ckd_stages(
]

# Create a new column in the DataFrame
df[stage_col] = np.select(conditions, choices, default="Not classified")
df[stage_col] = np.select(conditions, choices, default="Not Classified")

if combined_stage_col:
# Combine conditions for CKD stages 3, 4, and 5 according to eGFR values
Expand All @@ -106,7 +106,7 @@ def classify_ckd_stages(

# Create a new column in the DataFrame
df[combined_stage_col] = np.select(
[combined_conditions], combined_choices, default="Not classified"
[combined_conditions], combined_choices, default="Not Classified"
)

return df
Expand All @@ -117,7 +117,7 @@ def classify_ckd_stages(
################################################################################


def prep_and_plot_metrics_vars(
def plot_kfre_metrics(
df,
num_vars,
fig_size=(12, 6),
Expand Down Expand Up @@ -524,7 +524,7 @@ def prep_and_plot_metrics_vars(
################################################################################


def calculate_metrics_for_n_var(df, n_var_list):
def eval_kfre_metrics(df, n_var_list):
"""
Calculate metrics for multiple outcomes and store the results in a DataFrame.
Expand Down

0 comments on commit b8b3e3d

Please sign in to comment.