Documentation of internals

Modules

# PredictMD.PredictMD — Module.

source

# PredictMD.Cleaning — Module.

source

# PredictMD.Compilation — Module.

source

# PredictMD.GPU — Module.

source

# PredictMD.Server — Module.

source

Constants

# PredictMD.Fittable — Constant.

Fittable

source

Types

# PredictMD.AbstractEstimator — Type.

AbstractEstimator

source

# PredictMD.AbstractFeatureContrasts — Type.

AbstractFeatureContrasts

source

# PredictMD.AbstractPipeline — Type.

AbstractPipeline

source

# PredictMD.AbstractPlot — Type.

AbstractPlot{T}

source

# PredictMD.AbstractTransformer — Type.

AbstractTransformer

source

# PredictMD.DataFrameFeatureContrasts — Type.

source

# PredictMD.DataFrameFeatureContrasts — Method.

source

# PredictMD.DecisionTreeModel — Type.

source

# PredictMD.GLMModel — Type.

source

# PredictMD.ImmutableDataFrame2GLMSingleLabelBinaryClassTransformer — Type.

source

# PredictMD.ImmutableFeatureArrayTransposerTransformer — Type.

source

# PredictMD.ImmutablePackageMultiLabelPredictionTransformer — Type.

source

# PredictMD.ImmutablePackageSingleLabelPredictProbaTransformer — Type.

source

# PredictMD.ImmutablePackageSingleLabelPredictionTransformer — Type.

source

# PredictMD.ImmutablePredictProbaSingleLabelInt2StringTransformer — Type.

source

# PredictMD.ImmutablePredictionsSingleLabelInt2StringTransformer — Type.

source

# PredictMD.KnetModel — Type.

source

# PredictMD.LIBSVMModel — Type.

source

# PredictMD.MutableDataFrame2ClassificationKnetTransformer — Type.

source

# PredictMD.MutableDataFrame2DecisionTreeTransformer — Type.

source

# PredictMD.MutableDataFrame2RegressionKnetTransformer — Type.

source

# PredictMD.SimplePipeline — Type.

source

# PredictMD.SimplePipeline — Method.

source

Functions

# PredictMD.DataFrame2LIBSVMTransformer — Method.

source

# PredictMD._getlabelint2stringmap — Method.

source

# PredictMD._getlabelstring2intmap — Method.

source

# PredictMD._single_labeldataframeknetregression_Knet — Method.

source

# PredictMD._single_labeldataframelinearregression_GLM — Method.

source

# PredictMD._single_labeldataframerandomforestregression_DecisionTree — Method.

source

# PredictMD._single_labeldataframesvmregression_LIBSVM — Method.

source

# PredictMD._single_labelmulticlassdataframeknetclassifier_Knet — Method.

source

# PredictMD._single_labelmulticlassdataframesvmclassifier_LIBSVM — Method.

source

# PredictMD._single_labelmulticlassdfrandomforestclassifier_DecisionTree — Method.

source

# PredictMD._singlelabelbinaryclassdataframelogisticclassifier_GLM — Method.

source

# PredictMD._singlelabelbinaryclassdataframeprobitclassifier_GLM — Method.

source

# PredictMD._singlelabelbinaryclassificationmetrics — Method.

source

# PredictMD._singlelabelbinaryclassificationmetrics_tunableparam — Method.

source

# PredictMD._singlelabelregressionmetrics — Method.

source

# PredictMD.accuracy — Method.

source

# PredictMD.auprc — Method.

source

# PredictMD.aurocc — Method.

source

# PredictMD.averageprecisionscore — Method.

source

# PredictMD.avg_precision — Method.

source

# PredictMD.binary_brier_score — Method.

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_under — Method.

source

# PredictMD.check_column_types — Method.

source

# PredictMD.cohen_kappa — Method.

source

# PredictMD.cohen_kappa — Method.

source

# PredictMD.cohen_kappa — Method.

source

# PredictMD.compute_contingency_table — Method.

source

# PredictMD.compute_contingency_table — Method.

source

# PredictMD.convert_value_to_missing! — Function.

source

# PredictMD.delete_nothings! — Method.

source

# PredictMD.f1score — Method.

source

# PredictMD.false_negative_rate — Method.

source

# PredictMD.false_positive_rate — Method.

source

# PredictMD.fbetascore — Method.

source

# PredictMD.filename_extension — Method.

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_type — Function.

source

# PredictMD.generate_feature_contrasts — Method.

source

# PredictMD.generate_formula — Method.

source

# PredictMD.generate_formula — Method.

source

# PredictMD.generate_formula — Method.

source

# PredictMD.generate_formula — Method.

source

# PredictMD.generate_interaction_terms — Method.

source

# PredictMD.get_binary_thresholds — Method.

source

# PredictMD.get_history — Method.

source

# PredictMD.get_history — Method.

source

# PredictMD.get_history — Method.

source

# PredictMD.get_history — Method.

source

# PredictMD.get_history — Method.

source

# PredictMD.get_history — Method.

source

# PredictMD.get_history — Method.

source

# PredictMD.get_history — Method.

source

# PredictMD.get_history — Method.

source

# PredictMD.get_history — Method.

source

# PredictMD.get_history — Method.

source

# PredictMD.get_history — Method.

source

# PredictMD.get_history — Method.

source

# PredictMD.get_history — Method.

source

# PredictMD.get_history — Method.

source

# PredictMD.get_underlying — Method.

source

# PredictMD.get_underlying — Method.

source

# PredictMD.get_underlying — Method.

source

# PredictMD.get_underlying — Method.

source

# PredictMD.get_underlying — Method.

source

# PredictMD.get_underlying — Method.

source

# PredictMD.get_underlying — Method.

source

# PredictMD.get_underlying — Method.

source

# PredictMD.get_underlying — Method.

source

# PredictMD.get_underlying — Method.

source

# PredictMD.get_underlying — Method.

source

# PredictMD.get_underlying — Method.

source

# PredictMD.get_underlying — Method.

source

# PredictMD.get_underlying — Method.

source

# PredictMD.get_underlying — Method.

source

# PredictMD.getallrocnums — Method.

source

# PredictMD.icd9_code_to_single_level_dx_ccs — Method.

source

# PredictMD.inverse — Method.

source

# PredictMD.is_appveyor_ci — Function.

source

# PredictMD.is_ci — Function.

source

# PredictMD.is_ci_or_runtests — Function.

source

# PredictMD.is_ci_or_runtests_or_docs_or_examples — Function.

source

# PredictMD.is_deploy_docs — Function.

source

# PredictMD.is_docs_or_examples — Function.

source

# PredictMD.is_make_docs — Function.

source

# PredictMD.is_make_examples — Function.

source

# PredictMD.is_nothing — Function.

source

# PredictMD.is_one_to_one — Method.

source

# PredictMD.is_runtests — Function.

source

# PredictMD.is_square — Method.

source

# PredictMD.is_travis_ci — Function.

source

# PredictMD.is_travis_ci_on_apple — Function.

source

# PredictMD.is_travis_ci_on_linux — Function.

source

# PredictMD.load_model — Method.

source

# PredictMD.mean_square_error — Method.

mean_square_error(ytrue, ypred)

source

# PredictMD.multilabelprobabilitiestopredictions — Method.

source

# PredictMD.negative_predictive_value — Method.

source

# PredictMD.open_plots_during_tests — Function.

source

# PredictMD.package_directory — Method.

package_directory(parts...)::String

Equivalent to abspath(joinpath(abspath(package_directory()), parts...)).

source

# PredictMD.package_directory — Method.

package_directory(f::Function, types::Tuple, parts...)::String

Equivalent to result = abspath(joinpath(abspath(package_directory(f, types)), parts...)).

source

# PredictMD.package_directory — Method.

package_directory(f::Function, types::Tuple)::String

If function f with type signature types is part of a Julia package, returns the package root directory.

If function f with type signature types is not part of a Julia package, throws an error.

source

# PredictMD.package_directory — Method.

package_directory(f::Function, parts...)::String

Equivalent to result = abspath(joinpath(abspath(package_directory(f)), parts...)).

source

# PredictMD.package_directory — Method.

package_directory(f::Function)::String

If function f is part of a Julia package, returns the package root directory.

If function f is not part of a Julia package, throws an error.

source

# PredictMD.package_directory — Method.

package_directory(m::Method, parts...)::String

Equivalent to result = abspath(joinpath(abspath(package_directory(m)), parts...)).

source

# PredictMD.package_directory — Method.

package_directory(m::Method)::String

If method m is part of a Julia package, returns the package root directory.

If method m is not part of a Julia package, throws an error.

source

# PredictMD.package_directory — Method.

package_directory(m::Module, parts...)::String

Equivalent to result = abspath(joinpath(abspath(package_directory(m)), parts...)).

source

# PredictMD.package_directory — Method.

package_directory(m::Module)::String

If module m is part of a Julia package, returns the package root directory.

If module m is not part of a Julia package, throws an error.

source

# PredictMD.package_directory — Method.

package_directory()::String

Return the PredictMD package directory.

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.plot_probability_calibration_curve — Method.

source

# PredictMD.plot_probability_calibration_curve — Method.

source

# PredictMD.plotlearningcurves — Function.

source

# PredictMD.plotlearningcurves — Function.

source

# PredictMD.plotlearningcurves — Method.

source

# PredictMD.plotprcurves — Method.

source

# PredictMD.plotprcurves — Method.

source

# PredictMD.plotroccurves — Method.

source

# PredictMD.plotroccurves — Method.

source

# PredictMD.plotsinglelabelbinaryclassifierhistogram — Method.

source

# PredictMD.plotsinglelabelregressiontrueversuspredicted — Method.

source

# PredictMD.positive_predictive_value — Method.

source

# PredictMD.prcurve — Method.

source

# PredictMD.prcurve — Method.

source

# PredictMD.precision — Method.

source

# PredictMD.predict — Method.

source

# PredictMD.predict — Method.

source

# PredictMD.predict — Method.

source

# PredictMD.predict — Method.

source

# PredictMD.predict — Method.

source

# PredictMD.predict — Method.

source

# PredictMD.predict — Method.

source

# PredictMD.predict — Method.

source

# PredictMD.predict — Method.

source

# PredictMD.predict — Method.

source

# PredictMD.predict — Method.

source

# PredictMD.predict — Method.

source

# PredictMD.predict — Method.

source

# PredictMD.predict — Method.

source

# PredictMD.predict — Method.

source

# PredictMD.predict — Method.

source

# PredictMD.predict_proba — Method.

source

# PredictMD.predict_proba — Method.

source

# PredictMD.predict_proba — Method.

source

# PredictMD.predict_proba — Method.

source

# PredictMD.predict_proba — Method.

source

# PredictMD.predict_proba — Method.

source

# PredictMD.predict_proba — Method.

source

# PredictMD.predict_proba — Method.

source

# PredictMD.predict_proba — Method.

source

# PredictMD.predict_proba — Method.

source

# PredictMD.predict_proba — Method.

source

# PredictMD.predict_proba — Method.

source

# PredictMD.predict_proba — Method.

source

# PredictMD.predict_proba — Method.

source

# PredictMD.predict_proba — Method.

source

# PredictMD.predictionsassoctodataframe — Function.

source

# PredictMD.probability_calibration_metrics — Function.

source

# PredictMD.probability_calibration_metrics — Method.

source

# PredictMD.probability_calibration_scores_and_fractions — Method.

source

# PredictMD.probability_calibration_scores_and_fractions — Method.

source

# PredictMD.r2_score — Method.

r2_score(ytrue, ypred)

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

source

# PredictMD.recall — Method.

source

# PredictMD.risk_score_cutoff_values — Method.

source

# PredictMD.risk_score_cutoff_values — Method.

source

# PredictMD.roccurve — Method.

source

# PredictMD.roccurve — Method.

source

# PredictMD.root_mean_square_error — Method.

root_mean_square_error(ytrue, ypred)

source

# PredictMD.save_model — Method.

source

# PredictMD.sensitivity — 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_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_linear_regression — Method.

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.simple_moving_average — Method.

source

# PredictMD.single_labeldataframeknetregression — Method.

source

# PredictMD.single_labeldataframelinearregression — Method.

source

# PredictMD.single_labeldataframerandomforestregression — Method.

source

# PredictMD.single_labeldataframesvmregression — Method.

source

# PredictMD.single_labelmulticlassdataframeknetclassifier — Method.

source

# PredictMD.single_labelmulticlassdataframerandomforestclassifier — Method.

source

# PredictMD.single_labelmulticlassdataframesvmclassifier — Method.

source

# PredictMD.single_labelprobabilitiestopredictions — Method.

source

# PredictMD.singlelabelbinaryclassdataframelogisticclassifier — Method.

source

# PredictMD.singlelabelbinaryclassdataframeprobitclassifier — Method.

source

# PredictMD.singlelabelbinaryclassificationmetrics — Method.

source

# PredictMD.singlelabelbinaryclassificationmetrics — Method.

source

# PredictMD.singlelabelbinaryyscore — Method.

source

# PredictMD.singlelabelbinaryytrue — Method.

source

# PredictMD.singlelabelregressionmetrics — Method.

source

# PredictMD.singlelabelregressionmetrics — Method.

source

# PredictMD.singlelabelregressionypred — Method.

source

# PredictMD.singlelabelregressionytrue — Method.

source

# PredictMD.smote — Method.

source

# PredictMD.smote — Method.

source

# PredictMD.specificity — Method.

source

# PredictMD.split_data — Method.

source

# PredictMD.split_data — Method.

source

# PredictMD.transform — Function.

source

# PredictMD.transform — Function.

source

# PredictMD.transform — Method.

source

# PredictMD.transform — Method.

source

# PredictMD.transform — Method.

source

# PredictMD.transform — Method.

source

# PredictMD.transform — Method.

source

# PredictMD.transform — Method.

source

# PredictMD.transform — Method.

source

# PredictMD.transform — Method.

source

# PredictMD.transform_columns! — Function.

source

# PredictMD.trapz — Method.

trapz(x, y)

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

source

# PredictMD.true_negative_rate — Method.

source

# PredictMD.true_positive_rate — Method.

source

# PredictMD.tuplify — Function.

source

# PredictMD.underlying — Method.

source

# PredictMD.version — Method.

version(f::Function, types::Tuple)::VersionNumber

If function f with type signature types is part of a Julia package, returns the version number of that package.

If function f with type signature types is not part of a Julia package, throws an error.

source

# PredictMD.version — Method.

version(f::Function)::VersionNumber

If function f is part of a Julia package, returns the version number of that package.

If function f is not part of a Julia package, throws an error.

source

# PredictMD.version — Method.

version(m::Method)::VersionNumber

If method m is part of a Julia package, returns the version number of that package.

If method m is not part of a Julia package, throws an error.

source

# PredictMD.version — Method.

version(m::Module)::VersionNumber

If module m is part of a Julia package, returns the version number of that package.

If module m is not part of a Julia package, throws an error.

source

# PredictMD.version — Method.

version()::VersionNumber

Return the version number of PredictMD.

source

# PredictMD.Cleaning.ccs_onehot_names — Function.

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_icd9 — Method.

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

# PredictMD.Cleaning.column_names_with_prefix — Method.

source

# PredictMD.Cleaning.symbol_begins_with — Method.

source

# PredictMD.Cleaning.x_contains_y — Method.

source

Macros

Index