Documentation of internals

Modules

# PredictMDModule.

source

# PredictMD.CleaningModule.

source

# PredictMD.CompilationModule.

source

# PredictMD.GPUModule.

source

# PredictMD.ServerModule.

source

Constants

# PredictMD.FittableConstant.

Fittable

source

Types

# PredictMD.AbstractEstimatorType.

AbstractEstimator

source

# PredictMD.AbstractFeatureContrastsType.

AbstractFeatureContrasts

source

# PredictMD.AbstractPipelineType.

AbstractPipeline

source

# PredictMD.AbstractTransformerType.

AbstractTransformer

source

# PredictMD.DataFrameFeatureContrastsType.

source

# PredictMD.DataFrameFeatureContrastsMethod.

source

# PredictMD.DecisionTreeModelType.

source

# PredictMD.GLMModelType.

source

# PredictMD.ImmutableDataFrame2GLMSingleLabelBinaryClassTransformerType.

source

# PredictMD.ImmutableFeatureArrayTransposerTransformerType.

source

# PredictMD.ImmutablePackageMultiLabelPredictionTransformerType.

source

# PredictMD.ImmutablePackageSingleLabelPredictProbaTransformerType.

source

# PredictMD.ImmutablePackageSingleLabelPredictionTransformerType.

source

# PredictMD.ImmutablePredictProbaSingleLabelInt2StringTransformerType.

source

# PredictMD.ImmutablePredictionsSingleLabelInt2StringTransformerType.

source

# PredictMD.KnetModelType.

source

# PredictMD.LIBSVMModelType.

source

# PredictMD.MutableDataFrame2ClassificationKnetTransformerType.

source

# PredictMD.MutableDataFrame2DecisionTreeTransformerType.

source

# PredictMD.MutableDataFrame2RegressionKnetTransformerType.

source

# PredictMD.SimplePipelineType.

source

# PredictMD.SimplePipelineMethod.

source

Functions

# PredictMD.DataFrame2LIBSVMTransformerMethod.

source

# PredictMD._getlabelint2stringmapMethod.

source

# PredictMD._getlabelstring2intmapMethod.

source

# PredictMD._single_labeldataframeknetregression_KnetMethod.

source

# PredictMD._single_labeldataframelinearregression_GLMMethod.

source

# PredictMD._single_labeldataframerandomforestregression_DecisionTreeMethod.

source

# PredictMD._single_labeldataframesvmregression_LIBSVMMethod.

source

# PredictMD._single_labelmulticlassdataframeknetclassifier_KnetMethod.

source

# PredictMD._single_labelmulticlassdataframesvmclassifier_LIBSVMMethod.

source

# PredictMD._single_labelmulticlassdfrandomforestclassifier_DecisionTreeMethod.

source

# PredictMD._singlelabelbinaryclassdataframelogisticclassifier_GLMMethod.

source

# PredictMD._singlelabelbinaryclassdataframeprobitclassifier_GLMMethod.

source

# PredictMD._singlelabelbinaryclassificationmetricsMethod.

source

# PredictMD._singlelabelbinaryclassificationmetrics_tunableparamMethod.

source

# PredictMD._singlelabelregressionmetricsMethod.

source

# PredictMD.accuracyMethod.

source

# PredictMD.auprcMethod.

source

# PredictMD.auroccMethod.

source

# PredictMD.averageprecisionscoreMethod.

source

# PredictMD.avg_precisionMethod.

source

# PredictMD.binary_brier_scoreMethod.

binary_brier_score(ytrue, yscore)

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

Lower values are better. Best value is 0.

source

# PredictMD.calculate_smote_pct_underMethod.

source

# PredictMD.check_column_typesMethod.

source

# PredictMD.cohen_kappaMethod.

source

# PredictMD.cohen_kappaMethod.

source

# PredictMD.cohen_kappaMethod.

source

# PredictMD.compute_contingency_tableMethod.

source

# PredictMD.compute_contingency_tableMethod.

source

# PredictMD.convert_value_to_missing!Function.

source

# PredictMD.delete_nothings!Method.

source

# PredictMD.f1scoreMethod.

source

# PredictMD.false_negative_rateMethod.

source

# PredictMD.false_positive_rateMethod.

source

# PredictMD.fbetascoreMethod.

source

# PredictMD.filename_extensionMethod.

source

# PredictMD.fit!Function.

source

# PredictMD.fit!Function.

source

# PredictMD.fit!Function.

source

# PredictMD.fit!Method.

source

# PredictMD.fit!Method.

source

# PredictMD.fit!Method.

source

# PredictMD.fit!Method.

source

# PredictMD.fit!Method.

source

# PredictMD.fit!Method.

source

# PredictMD.fit!Method.

source

# PredictMD.fit!Method.

source

# PredictMD.fit!Method.

source

# PredictMD.fit!Method.

source

# PredictMD.fit!Method.

source

# PredictMD.fit!Method.

source

# PredictMD.fix_column_types!Method.

source

# PredictMD.fix_typeFunction.

source

# PredictMD.generate_docsMethod.

source

# PredictMD.generate_feature_contrastsMethod.

source

# PredictMD.generate_formulaMethod.

source

# PredictMD.generate_formulaMethod.

source

# PredictMD.generate_formulaMethod.

source

# PredictMD.generate_formulaMethod.

source

# PredictMD.generate_interaction_termsMethod.

source

# PredictMD.get_binary_thresholdsMethod.

source

# PredictMD.get_historyMethod.

source

# PredictMD.get_historyMethod.

source

# PredictMD.get_historyMethod.

source

# PredictMD.get_historyMethod.

source

# PredictMD.get_historyMethod.

source

# PredictMD.get_historyMethod.

source

# PredictMD.get_historyMethod.

source

# PredictMD.get_historyMethod.

source

# PredictMD.get_historyMethod.

source

# PredictMD.get_historyMethod.

source

# PredictMD.get_historyMethod.

source

# PredictMD.get_historyMethod.

source

# PredictMD.get_historyMethod.

source

# PredictMD.get_historyMethod.

source

# PredictMD.get_historyMethod.

source

# PredictMD.get_underlyingMethod.

source

# PredictMD.get_underlyingMethod.

source

# PredictMD.get_underlyingMethod.

source

# PredictMD.get_underlyingMethod.

source

# PredictMD.get_underlyingMethod.

source

# PredictMD.get_underlyingMethod.

source

# PredictMD.get_underlyingMethod.

source

# PredictMD.get_underlyingMethod.

source

# PredictMD.get_underlyingMethod.

source

# PredictMD.get_underlyingMethod.

source

# PredictMD.get_underlyingMethod.

source

# PredictMD.get_underlyingMethod.

source

# PredictMD.get_underlyingMethod.

source

# PredictMD.get_underlyingMethod.

source

# PredictMD.get_underlyingMethod.

source

# PredictMD.getallrocnumsMethod.

source

# PredictMD.icd9_code_to_single_level_dx_ccsMethod.

source

# PredictMD.inverseMethod.

source

# PredictMD.is_appveyor_ciFunction.

source

# PredictMD.is_ciFunction.

source

# PredictMD.is_ci_or_runtestsFunction.

source

# PredictMD.is_ci_or_runtests_or_docs_or_examplesFunction.

source

# PredictMD.is_deploy_docsFunction.

source

# PredictMD.is_docs_or_examplesFunction.

source

# PredictMD.is_make_docsFunction.

source

# PredictMD.is_make_examplesFunction.

source

# PredictMD.is_nothingFunction.

source

# PredictMD.is_one_to_oneMethod.

source

# PredictMD.is_runtestsFunction.

source

# PredictMD.is_squareMethod.

source

# PredictMD.is_travis_ciFunction.

source

# PredictMD.is_travis_ci_on_appleFunction.

source

# PredictMD.is_travis_ci_on_linuxFunction.

source

# PredictMD.load_modelMethod.

source

# PredictMD.mean_square_errorMethod.

mean_square_error(ytrue, ypred)

source

# PredictMD.multilabelprobabilitiestopredictionsMethod.

source

# PredictMD.negative_predictive_valueMethod.

source

# PredictMD.next_major_versionMethod.

source

# PredictMD.next_minor_versionMethod.

source

# PredictMD.open_browser_windowFunction.

source

# PredictMD.open_browser_windowFunction.

source

# PredictMD.open_plotMethod.

source

# PredictMD.open_plotMethod.

source

# PredictMD.open_plots_during_testsFunction.

source

# PredictMD.ordinary_least_squares_regressionMethod.

ordinary_least_squares_regression(x, y; intercept = true)

Find the best fit line to the set of 2-dimensional points (x, y) using the ordinary least squares method.

If intercept is true (default), fit a line of the form y = a + b*x (where a and b are real numbers) and return the tuple (a, b)

If intercept is false, fit a line of the form y = b*x (where b is a real number) and return the tuple (0, b)

source

# PredictMD.parse_functions!Method.

source

# PredictMD.parse_functions!Method.

source

# PredictMD.parse_functions!Method.

source

# PredictMD.parse_functions!Method.

source

# PredictMD.parse_functions!Method.

source

# PredictMD.parse_functions!Method.

source

# PredictMD.parse_functions!Method.

source

# PredictMD.parse_functions!Method.

source

# PredictMD.parse_functions!Method.

source

# PredictMD.parse_functions!Method.

source

# PredictMD.parse_functions!Method.

source

# PredictMD.parse_functions!Method.

source

# PredictMD.parse_functions!Method.

source

# PredictMD.parse_functions!Method.

source

# PredictMD.pkg_dirFunction.

source

# PredictMD.plot_probability_calibration_curveFunction.

source

# PredictMD.plot_probability_calibration_curveMethod.

source

# PredictMD.plotlearningcurvesFunction.

source

# PredictMD.plotlearningcurvesFunction.

source

# PredictMD.plotlearningcurvesMethod.

source

# PredictMD.plotprcurvesMethod.

source

# PredictMD.plotprcurvesMethod.

source

# PredictMD.plotroccurvesMethod.

source

# PredictMD.plotroccurvesMethod.

source

# PredictMD.plotsinglelabelbinaryclassifierhistogramMethod.

source

# PredictMD.plotsinglelabelregressiontrueversuspredictedMethod.

source

# PredictMD.positive_predictive_valueMethod.

source

# PredictMD.prcurveMethod.

source

# PredictMD.prcurveMethod.

source

# PredictMD.precisionMethod.

source

# PredictMD.predictMethod.

source

# PredictMD.predictMethod.

source

# PredictMD.predictMethod.

source

# PredictMD.predictMethod.

source

# PredictMD.predictMethod.

source

# PredictMD.predictMethod.

source

# PredictMD.predictMethod.

source

# PredictMD.predictMethod.

source

# PredictMD.predictMethod.

source

# PredictMD.predictMethod.

source

# PredictMD.predictMethod.

source

# PredictMD.predictMethod.

source

# PredictMD.predictMethod.

source

# PredictMD.predictMethod.

source

# PredictMD.predictMethod.

source

# PredictMD.predictMethod.

source

# PredictMD.predict_probaMethod.

source

# PredictMD.predict_probaMethod.

source

# PredictMD.predict_probaMethod.

source

# PredictMD.predict_probaMethod.

source

# PredictMD.predict_probaMethod.

source

# PredictMD.predict_probaMethod.

source

# PredictMD.predict_probaMethod.

source

# PredictMD.predict_probaMethod.

source

# PredictMD.predict_probaMethod.

source

# PredictMD.predict_probaMethod.

source

# PredictMD.predict_probaMethod.

source

# PredictMD.predict_probaMethod.

source

# PredictMD.predict_probaMethod.

source

# PredictMD.predict_probaMethod.

source

# PredictMD.predict_probaMethod.

source

# PredictMD.predictionsassoctodataframeFunction.

source

# PredictMD.probability_calibration_metricsFunction.

source

# PredictMD.probability_calibration_metricsMethod.

source

# PredictMD.probability_calibration_scores_and_fractionsMethod.

source

# PredictMD.probability_calibration_scores_and_fractionsMethod.

source

# PredictMD.r2_scoreMethod.

r2_score(ytrue, ypred)

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

source

# PredictMD.recallMethod.

source

# PredictMD.risk_score_cutoff_valuesMethod.

source

# PredictMD.risk_score_cutoff_valuesMethod.

source

# PredictMD.roccurveMethod.

source

# PredictMD.roccurveMethod.

source

# PredictMD.root_mean_square_errorMethod.

root_mean_square_error(ytrue, ypred)

source

# PredictMD.save_modelMethod.

source

# PredictMD.save_plotMethod.

source

# PredictMD.save_plot_pdfMethod.

source

# PredictMD.save_plot_svgMethod.

source

# PredictMD.save_plot_texMethod.

source

# PredictMD.save_plot_tikzMethod.

source

# PredictMD.sensitivityMethod.

source

# PredictMD.set_feature_contrasts!Method.

source

# PredictMD.set_feature_contrasts!Method.

source

# PredictMD.set_feature_contrasts!Method.

source

# PredictMD.set_feature_contrasts!Method.

source

# PredictMD.set_feature_contrasts!Method.

source

# PredictMD.set_feature_contrasts!Method.

source

# PredictMD.set_feature_contrasts!Method.

source

# PredictMD.set_feature_contrasts!Method.

source

# PredictMD.set_feature_contrasts!Method.

source

# PredictMD.set_feature_contrasts!Method.

source

# PredictMD.set_feature_contrasts!Method.

source

# PredictMD.set_feature_contrasts!Method.

source

# PredictMD.set_feature_contrasts!Method.

source

# PredictMD.set_feature_contrasts!Method.

source

# PredictMD.set_feature_contrasts!Method.

source

# PredictMD.set_max_epochs!Method.

source

# PredictMD.set_max_epochs!Method.

source

# PredictMD.set_max_epochs!Method.

source

# PredictMD.shuffle_rows!Method.

source

# PredictMD.shuffle_rows!Method.

source

# PredictMD.simple_moving_averageMethod.

source

# PredictMD.single_labeldataframeknetregressionMethod.

source

# PredictMD.single_labeldataframelinearregressionMethod.

source

# PredictMD.single_labeldataframerandomforestregressionMethod.

source

# PredictMD.single_labeldataframesvmregressionMethod.

source

# PredictMD.single_labelmulticlassdataframeknetclassifierMethod.

source

# PredictMD.single_labelmulticlassdataframerandomforestclassifierMethod.

source

# PredictMD.single_labelmulticlassdataframesvmclassifierMethod.

source

# PredictMD.single_labelprobabilitiestopredictionsMethod.

source

# PredictMD.singlelabelbinaryclassdataframelogisticclassifierMethod.

source

# PredictMD.singlelabelbinaryclassdataframeprobitclassifierMethod.

source

# PredictMD.singlelabelbinaryclassificationmetricsMethod.

source

# PredictMD.singlelabelbinaryclassificationmetricsMethod.

source

# PredictMD.singlelabelbinaryyscoreMethod.

source

# PredictMD.singlelabelbinaryytrueMethod.

source

# PredictMD.singlelabelregressionmetricsMethod.

source

# PredictMD.singlelabelregressionmetricsMethod.

source

# PredictMD.singlelabelregressionypredMethod.

source

# PredictMD.singlelabelregressionytrueMethod.

source

# PredictMD.smoteMethod.

source

# PredictMD.smoteMethod.

source

# PredictMD.specificityMethod.

source

# PredictMD.split_dataMethod.

source

# PredictMD.split_dataMethod.

source

# PredictMD.transformFunction.

source

# PredictMD.transformFunction.

source

# PredictMD.transformMethod.

source

# PredictMD.transformMethod.

source

# PredictMD.transformMethod.

source

# PredictMD.transformMethod.

source

# PredictMD.transformMethod.

source

# PredictMD.transformMethod.

source

# PredictMD.transformMethod.

source

# PredictMD.transformMethod.

source

# PredictMD.transform_columns!Function.

source

# PredictMD.trapzMethod.

trapz(x, y)

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

source

# PredictMD.true_negative_rateMethod.

source

# PredictMD.true_positive_rateMethod.

source

# PredictMD.tuplifyFunction.

source

# PredictMD.underlyingMethod.

source

# PredictMD.versionMethod.

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,
        )
    )

Compat.@info(PredictMD.Cleaning.ccs_onehot_names(df))
Compat.@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,
        )
    )

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

source

# PredictMD.Cleaning.column_names_with_prefixMethod.

source

# PredictMD.Cleaning.symbol_begins_withMethod.

source

# PredictMD.Cleaning.x_contains_yMethod.

source

Macros

Index