Documentation of internals

Modules

Constants

Types

Functions

PredictMD.binary_brier_scoreMethod
binary_brier_score(ytrue, yscore)

Computes the binary formulation of the Brier score, defined as:

\[\frac{1}{N}\sum\limits _{t=1}^{N}(f_t-o_t)^2 \,\!\]

Lower values are better. Best value is 0.

source
PredictMD.r2_scoreMethod
r2_score(ytrue, ypred)

Computes coefficient of determination. Higher values are better. Best value is 1.

source
PredictMD.simple_linear_regressionMethod
simple_linear_regression(x::AbstractVector, y::AbstractVector)

Simple linear regression - given a set of two-dimensional points (x, y), use the ordinary least squares method to find the best fit line of the form y = a + b*x (where a and b are real numbers) and return the tuple (a, b).

source
PredictMD.trapzFunction
trapz(x, y)

Compute the area under the curve of 2-dimensional points (x, y) using the trapezoidal method.

source
PredictMD.Cleaning.ccs_onehot_namesFunction

Given a dataframe, return the column names corresponding to CCS "one-hot" columns.

Examples

import CSVFiles
import FileIO
import PredictMD

df = DataFrames.DataFrame(
    FileIO.load(
        MY_CSV_FILE_NAME;
        type_detect_rows = 30_000,
        )
    )

@info(PredictMD.Cleaning.ccs_onehot_names(df))
@info(PredictMD.Cleaning.ccs_onehot_names(df, "ccs_onehot_"))
source
PredictMD.Cleaning.clean_hcup_nis_csv_icd9Method

Given a single ICD 9 code, import the relevant patients from the Health Care Utilization Project (HCUP) National Inpatient Sample (NIS) database.

Examples:

import CSVFiles
import FileIO
import PredictMD

icd_code_list = ["8841"]
icd_code_type=:procedure
input_file_name_list = [
    "./data/nis_2012_core.csv",
    "./data/nis_2013_core.csv",
    "./data/nis_2014_core.csv",
    ]
output_file_name = "./output/hcup_nis_pr_8841.csv"

PredictMD.Cleaning.clean_hcup_nis_csv_icd9(
    icd_code_list,
    input_file_name_list,
    output_file_name;
    icd_code_type=icd_code_type,
    rows_for_type_detect = 30_000,
    )

df = DataFrames.DataFrame(
    FileIO.load(
        output_file_name;
        type_detect_rows = 30_000,
        )
    )

@info(PredictMD.Cleaning.ccs_onehot_names(df))
source

Macros

Index