API Reference
Documentation for the iai package
Index
iai::acquire_licenseiai::add_julia_processesiai::all_treatment_combinationsiai::applyiai::apply_nodesiai::as.mixeddataggplot2::autoplot.grid_searchggplot2::autoplot.roc_curveggplot2::autoplot.similarity_comparisonggplot2::autoplot.stability_analysisiai::categorical_classification_reward_estimatoriai::categorical_regression_reward_estimatoriai::categorical_survival_reward_estimatoriai::cleanup_installationiai::cloneiai::convert_treatments_to_numericiai::copy_splits_and_refit_leavesiai::decision_pathiai::delete_rich_output_paramiai::equal_propensity_estimatoriai::fit_and_expandiai::fit_cviai::fit.grid_searchiai::fit.imputation_learneriai::fit.learneriai::fit.optimal_feature_selection_learneriai::fit_predictiai::fit_predict.categorical_reward_estimatoriai::fit_predict.numeric_reward_estimatoriai::fit_transformiai::fit_transform_cviai::get_best_paramsiai::get_classification_label.classification_tree_learneriai::get_classification_label.classification_tree_multi_learneriai::get_classification_proba.classification_tree_learneriai::get_classification_proba.classification_tree_multi_learneriai::get_cluster_assignmentsiai::get_cluster_detailsiai::get_cluster_distancesiai::get_depthiai::get_estimation_densitiesiai::get_features_usediai::get_grid_result_detailsiai::get_grid_result_summaryiai::get_learneriai::get_lower_childiai::get_machine_idiai::get_num_fits.glmnetcv_learneriai::get_num_fits.optimal_feature_selection_learneriai::get_num_nodesiai::get_num_samplesiai::get_paramsiai::get_parentiai::get_policy_treatment_outcomeiai::get_policy_treatment_outcome_standard_erroriai::get_policy_treatment_rankiai::get_prediction_constant.glmnetcv_learneriai::get_prediction_constant.optimal_feature_selection_learneriai::get_prediction_weights.glmnetcv_learneriai::get_prediction_weights.optimal_feature_selection_learneriai::get_prescription_treatment_rankiai::get_regression_constant.classification_tree_learneriai::get_regression_constant.classification_tree_multi_learneriai::get_regression_constant.prescription_tree_learneriai::get_regression_constant.regression_tree_learneriai::get_regression_constant.regression_tree_multi_learneriai::get_regression_constant.survival_tree_learneriai::get_regression_weights.classification_tree_learneriai::get_regression_weights.classification_tree_multi_learneriai::get_regression_weights.prescription_tree_learneriai::get_regression_weights.regression_tree_learneriai::get_regression_weights.regression_tree_multi_learneriai::get_regression_weights.survival_tree_learneriai::get_rich_output_paramsiai::get_roc_curve_dataiai::get_split_categoriesiai::get_split_featureiai::get_split_thresholdiai::get_split_weightsiai::get_stability_resultsiai::get_survival_curveiai::get_survival_curve_dataiai::get_survival_expected_timeiai::get_survival_hazardiai::get_train_errorsiai::get_treeiai::get_upper_childiai::glmnetcv_classifieriai::glmnetcv_regressoriai::glmnetcv_survival_learneriai::grid_searchiai::iai_setupiai::imputation_learneriai::imputeiai::impute_cviai::install_juliaiai::install_system_imageiai::is_categoric_splitiai::is_hyperplane_splitiai::is_leafiai::is_mixed_ordinal_splitiai::is_mixed_parallel_splitiai::is_ordinal_splitiai::is_parallel_splitiai::load_graphviziai::mean_imputation_learneriai::missing_goes_loweriai::multi_questionnaire.defaultiai::multi_questionnaire.grid_searchiai::multi_tree_plot.defaultiai::multi_tree_plot.grid_searchiai::numeric_classification_reward_estimatoriai::numeric_regression_reward_estimatoriai::numeric_survival_reward_estimatoriai::opt_knn_imputation_learneriai::opt_svm_imputation_learneriai::opt_tree_imputation_learneriai::optimal_feature_selection_classifieriai::optimal_feature_selection_regressoriai::optimal_tree_classifieriai::optimal_tree_multi_classifieriai::optimal_tree_multi_regressoriai::optimal_tree_policy_maximizeriai::optimal_tree_policy_minimizeriai::optimal_tree_prescription_maximizeriai::optimal_tree_prescription_minimizeriai::optimal_tree_regressoriai::optimal_tree_survival_learnerplot.grid_searchplot.roc_curveplot.similarity_comparisonplot.stability_analysisiai::predict_expected_survival_time.glmnetcv_survival_learneriai::predict_expected_survival_time.survival_curveiai::predict_expected_survival_time.survival_learneriai::predict_hazard.glmnetcv_survival_learneriai::predict_hazard.survival_learneriai::predict.categorical_reward_estimatoriai::predict.glmnetcv_learneriai::predict.numeric_reward_estimatoriai::predict.optimal_feature_selection_learneriai::predict.supervised_learneriai::predict.supervised_multi_learneriai::predict.survival_learneriai::predict_outcomes.policy_learneriai::predict_outcomes.prescription_learneriai::predict_proba.classification_learneriai::predict_proba.classification_multi_learneriai::predict_proba.glmnetcv_classifieriai::predict_reward.categorical_reward_estimatoriai::predict_reward.numeric_reward_estimatoriai::predict_shapiai::predict_treatment_outcomeiai::predict_treatment_outcome_standard_erroriai::predict_treatment_rankiai::print_pathiai::prune_treesiai::questionnaireiai::questionnaire.optimal_feature_selection_learneriai::questionnaire.tree_learneriai::rand_imputation_learneriai::random_forest_classifieriai::random_forest_regressoriai::random_forest_survival_learneriai::read_jsoniai::refit_leavesiai::release_licenseiai::reset_display_labeliai::resume_from_checkpointiai::roc_curveiai::roc_curve.classification_learneriai::roc_curve.classification_multi_learneriai::roc_curve.defaultiai::roc_curve.glmnetcv_classifieriai::score.categorical_reward_estimatoriai::score.defaultiai::score.glmnetcv_learneriai::score.numeric_reward_estimatoriai::score.optimal_feature_selection_learneriai::score.supervised_learneriai::score.supervised_multi_learneriai::set_display_labeliai::set_julia_seediai::set_paramsiai::set_reward_kernel_bandwidthiai::set_rich_output_paramiai::set_thresholdiai::show_in_browser.abstract_visualizationiai::show_in_browser.roc_curveiai::show_in_browser.tree_learneriai::show_questionnaire.optimal_feature_selection_learneriai::show_questionnaire.tree_learneriai::similarity_comparisoniai::single_knn_imputation_learneriai::split_dataiai::stability_analysisiai::transformiai::transform_and_expandiai::tree_plotiai::tune_reward_kernel_bandwidthiai::variable_importance.learneriai::variable_importance.optimal_feature_selection_learneriai::variable_importance.tree_learneriai::variable_importance_similarityiai::write_boosteriai::write_dotiai::write_html.abstract_visualizationiai::write_html.roc_curveiai::write_html.tree_learneriai::write_jsoniai::write_pdfiai::write_pngiai::write_questionnaire.optimal_feature_selection_learneriai::write_questionnaire.tree_learneriai::write_svgiai::xgboost_classifieriai::xgboost_regressoriai::xgboost_survival_learneriai::zero_imputation_learner
Setup
iai::iai_setup — Function
iai_setup(...)Initialize Julia and the IAI package.
This function is called automatically with default parameters the first time any iai function is used in an R session. If custom parameters for Julia setup are required, this function must be called in every R session before calling other iai functions.
Arguments
...: All parameters are passed through toJuliaCall::julia_setup
iai::install_julia — Function
install_julia(version = "latest", prefix = julia_default_install_dir())Download and install Julia automatically.
Arguments
version: The version of Julia to install (e.g."1.6.3"). Defaults to"latest", which will install the most recent stable release.prefix: The directory where Julia will be installed. Defaults to a location determined byrappdirs::user_data_dir.
iai::install_system_image — Function
install_system_image(
version = "latest",
replace_default = FALSE,
prefix = sysimage_default_install_dir(),
accept_license = FALSE
)Download and install the IAI system image automatically.
Arguments
version: The version of the IAI system image to install (e.g."2.1.0"). Defaults to"latest", which will install the most recent release.replace_default: Whether to replace the default Julia system image with the downloaded IAI system image. Defaults toFALSE.prefix: The directory where the IAI system image will be installed. Defaults to a location determined byrappdirs::user_data_dir.accept_license: Set toTRUEto confirm that you agree to the End User License Agreement and skip the interactive confirmation dialog.
iai::cleanup_installation — Function
cleanup_installation()Remove all traces of automatic Julia/IAI installation
Removes files created by install_julia and install_system_image
iai::get_machine_id — Function
get_machine_id()Return the machine ID for the current computer.
This ID ties the IAI license file to your machine.
iai::acquire_license — Function
acquire_license(...)Acquire an IAI license for the current session.
Julia Equivalent: IAI.acquire_license
Arguments
...: Refer to the Julia documentation for available parameters
iai::release_license — Function
release_license()Release any IAI license held by the current session.
Julia Equivalent: IAI.release_license
iai::load_graphviz — Function
load_graphviz()Loads the Julia Graphviz library to permit certain visualizations.
The library will be installed if not already present.
General Utilities
iai::set_julia_seed — Function
set_julia_seed(seed)Set the random seed in Julia
Julia Equivalent: Random.seed!
Arguments
seed: The seed to set
iai::add_julia_processes — Function
add_julia_processes(...)Add additional Julia worker processes to parallelize workloads
Julia Equivalent: Distributed.addprocs!
For more information, refer to the documentation on parallelization
Arguments
...: Refer to the Julia documentation for available parameters
iai::get_rich_output_params — Function
get_rich_output_params()Return the current global rich output parameter settings
Julia Equivalent: IAI.get_rich_output_params
iai::set_rich_output_param — Function
set_rich_output_param(key, value)Sets a global rich output parameter
Julia Equivalent: IAI.set_rich_output_param!
Arguments
key: The parameter to set.value: The value to set
iai::delete_rich_output_param — Function
delete_rich_output_param(key)Delete a global rich output parameter
Julia Equivalent: IAI.delete_rich_output_param!
Arguments
key: The parameter to delete.
iai::resume_from_checkpoint — Function
resume_from_checkpoint(checkpoint_file)Resume training from a checkpoint file
Julia Equivalent: IAI.resume_from_checkpoint
Arguments
checkpoint_file: The location of the checkpoint file.
Data Preparation
iai::as.mixeddata — Function
as.mixeddata(values, categorical_levels, ordinal_levels = c())Convert a vector of values to IAI mixed data format
Julia Equivalent: IAI.make_mixed_data
Arguments
values: The vector of values to convertcategorical_levels: The values invaluesto treat as categoric levelsordinal_levels: (optional) The values invaluesto treat as ordinal levels, in the order supplied
iai::split_data — Function
split_data(task, X, ...)Split the data into training and test datasets
Julia Equivalent: IAI.split_data
Arguments
task: The type of problem.X: The features of the data....: Other parameters, including zero or more target vectors as required by the problem type. Refer to the Julia documentation for available parameters.
Scoring
iai::score.default — Function
score(obj, predictions, truths, ...)Calculate the score for a set of predictions on the given data
Julia Equivalent: IAI.score
Arguments
obj: The type of problem.predictions: The predictions to evaluate.truths: The true target values for these observations....: Other parameters, including the criterion. Refer to the Julia documentation for available parameters.
Learners
General learners
iai::fit.learner — Function
fit(obj, X, ...)Fits a model to the training data
Julia Equivalent: IAI.fit!
Arguments
obj: The learner to fit.X: The features of the data....: Other parameters, including zero or more target vectors as required by the problem type. Refer to the Julia documentation for available parameters.
iai::variable_importance.learner — Function
variable_importance(obj, ...)Generate a ranking of the variables in a learner according to their importance during training. The results are normalized so that they sum to one.
Julia Equivalent: IAI.variable_importance
Arguments
obj: The learner to query....: Refer to the Julia documentation for available parameters.
iai::get_features_used — Function
get_features_used(lnr)Return the names of the features used by the learner
Julia Equivalent: IAI.get_features_used
Arguments
lnr: The learner to query.
iai::set_params — Function
set_params(lnr, ...)Set all supplied parameters on a learner
Julia Equivalent: IAI.set_params!
Arguments
lnr: The learner to modify....: The parameters to set on the learner.
iai::get_params — Function
get_params(lnr)Return the value of all parameters on a learner
Julia Equivalent: IAI.get_params
Arguments
lnr: The learner to query.
iai::clone — Function
clone(lnr)Return an unfitted copy of a learner with the same parameters
Julia Equivalent: IAI.clone
Arguments
lnr: The learner to copy.
iai::read_json — Function
read_json(filename)Read in a learner or grid saved in JSON format
Julia Equivalent: IAI.read_json
Arguments
filename: The location of the JSON file.
iai::write_json — Function
write_json(filename, obj, ...)Output a learner or grid in JSON format
Julia Equivalent: IAI.write_json
Arguments
filename: Where to save the output.obj: The learner or grid to output....: Refer to the Julia documentation for available parameters.
Supervised learners
iai::predict.supervised_learner — Function
predict(obj, X, ...)Return the predictions made by a supervised learner for each point in the features
Julia Equivalent: IAI.predict
Arguments
obj: The learner or grid to use for prediction.X: The features of the data....: Refer to the Julia documentation for available parameters.
iai::score.supervised_learner — Function
score(obj, X, ...)Calculate the score for a model on the given data
Julia Equivalent: IAI.score
Arguments
obj: The learner or grid to evaluate.X: The features of the data....: Other parameters, including zero or more target vectors as required by the problem type. Refer to the Julia documentation for available parameters.
Classification learners
iai::predict_proba.classification_learner — Function
predict_proba(obj, X, ...)Return the probabilities of class membership predicted by a classification learner for each point in the features
Julia Equivalent: IAI.predict_proba
Arguments
obj: The learner or grid to use for prediction.X: The features of the data....: Additional arguments (unused)
iai::roc_curve — Function
roc_curve(obj, ...)Generic function for constructing an ROC curve
Julia Equivalent: IAI.ROCCurve
Arguments
obj: The object controlling which method is used...: Arguments depending on the specific method used
iai::roc_curve.classification_learner — Function
roc_curve(obj, X, y, ...)Construct an ROC curve using a trained classification learner on the given data
Julia Equivalent: IAI.ROCCurve
Arguments
obj: The learner or grid to use for prediction.X: The features of the data.y: The labels of the data....: Refer to the Julia documentation for available parameters.
iai::roc_curve.default — Function
roc_curve(obj, y, positive_label = stop("`positive_label` is required"), ...)Construct an ROC curve from predicted probabilities and true labels
Julia Equivalent: IAI.ROCCurve
Arguments
obj: The predicted probabilities for each point in the data.y: The true labels of the data.positive_label: The label for which probability is being predicted....: Additional arguments (unused)
iai::get_roc_curve_data — Function
get_roc_curve_data(curve)Extract the underlying data from an ROC curve
ROC curves are returned by roc_curve, e.g. roc_curve.classification_learner
The data is returned as a list with two keys: auc giving the area-under-the-curve, and coords containing a vector of lists representing each point on the curve, each with keys fpr (the false positive rate), tpr (the true positive rate) and threshold (the threshold).
Julia Equivalent: IAI.get_roc_curve_data
Arguments
curve: The curve to query.
plot.roc_curve — Function
ggplot2::autoplot.roc_curve — Function
ggplot2::autoplot(object, ...)Construct a ggplot2::ggplot object plotting the ROC curve
Arguments
object: The ROC curve to plot...: Additional arguments (unused)
iai::write_html.roc_curve — Function
write_html(filename, obj, ...)Output an ROC curve as an interactive browser visualization in HTML format
Julia Equivalent: IAI.write_html
Arguments
filename: Where to save the output.obj: The curve to output....: Refer to the Julia documentation for available parameters.
iai::show_in_browser.roc_curve — Function
show_in_browser(obj, ...)Show interactive visualization of a roc_curve in the default browser
Julia Equivalent: IAI.show_in_browser
Arguments
obj: The curve to visualize....: Refer to the Julia documentation for available parameters.
Survival learners
iai::predict.survival_learner — Function
predict(obj, X, t = NULL, ...)Return the predictions made by a survival learner for each point in the features
Julia Equivalent: IAI.predict
Arguments
obj: The learner or grid to use for prediction.X: The features of the data.t: The time for which to predict survival probability, defaulting to returning the entire survival curve if not supplied...: Additional arguments (unused)
iai::predict_hazard.survival_learner — Function
predict_hazard(obj, X, ...)Return the fitted hazard coefficient estimate made by a survival learner for each point in the features.
A higher hazard coefficient estimate corresponds to a smaller predicted survival time.
Julia Equivalent: IAI.predict_hazard
Arguments
obj: The learner or grid to use for prediction.X: The features of the data....: Additional arguments (unused)
iai::predict_expected_survival_time.survival_learner — Function
predict_expected_survival_time(obj, X, ...)Return the expected survival time estimate made by a survival learner for each point in the features.
Julia Equivalent: IAI.predict_expected_survival_time
Arguments
obj: The learner or grid to use for prediction.X: The features of the data....: Additional arguments (unused)
iai::get_survival_curve_data — Function
get_survival_curve_data(curve)Extract the underlying data from a survival curve (as returned by predict.survival_learner or get_survival_curve)
The data is returned as a list with two keys: times containing the time for each breakpoint on the curve, and coefs containing the probability for each breakpoint on the curve.
Julia Equivalent: IAI.get_survival_curve_data
Arguments
curve: The curve to query.
iai::predict_expected_survival_time.survival_curve — Function
predict_expected_survival_time(obj, ...)Return the expected survival time estimate made by a survival curve (as returned by predict.survival_learner or get_survival_curve)
Julia Equivalent: IAI.predict_expected_survival_time
Arguments
obj: The survival curve to use for prediction....: Additional arguments (unused)
Prescription learners
iai::predict_outcomes.prescription_learner — Function
predict_outcomes(obj, X, ...)Return the predicted outcome for each treatment made by a prescription learner for each point in the features
Julia Equivalent: IAI.predict_outcomes
Arguments
obj: The learner or grid to use for prediction.X: The features of the data....: Additional arguments (unused)
Policy learners
iai::predict_outcomes.policy_learner — Function
predict_outcomes(obj, X, rewards, ...)Return the predicted outcome for each treatment made by a policy learner for each point in the features
Julia Equivalent: IAI.predict_outcomes
Arguments
obj: The learner or grid to use for prediction.X: The features of the data.rewards: The estimated reward matrix for the data....: Additional arguments (unused)
iai::predict_treatment_rank — Function
predict_treatment_rank(lnr, X)Return the treatments in ranked order of effectiveness for each point in the features
Julia Equivalent: IAI.predict_treatment_rank
Arguments
lnr: The learner or grid to use for prediction.X: The features of the data.
iai::predict_treatment_outcome — Function
predict_treatment_outcome(lnr, X)Return the estimated quality of each treatment in the trained model of the learner for each point in the features
Julia Equivalent: IAI.predict_treatment_outcome
Arguments
lnr: The learner or grid to use for prediction.X: The features of the data.
iai::predict_treatment_outcome_standard_error — Function
predict_treatment_outcome_standard_error(lnr, X)Return the standard error for the estimated quality of each treatment in the trained model of the learner for each point in the features
Julia Equivalent: IAI.predict_treatment_outcome_standard_error
Arguments
lnr: The learner or grid to use for prediction.X: The features of the data.
Imputation learners
iai::fit.imputation_learner — Function
fit(obj, X, ...)Fits an imputation learner to the training data.
Additional keyword arguments are available for fitting imputation learners - please refer to the Julia documentation.
Julia Equivalent: IAI.fit!
Arguments
obj: The learner or grid to fit.X: The features of the data....: Refer to the Julia documentation for available parameters.
iai::fit_transform — Function
fit_transform(lnr, X, ...)Fit an imputation model using the given features and impute the missing values in these features
Similar to calling fit.imputation_learner followed by transform
Julia Equivalent: IAI.fit_transform!
Arguments
lnr: The learner or grid to use for imputationX: The features of the data....: Refer to the Julia documentation for available parameters.
iai::transform — Function
transform(lnr, X)Impute missing values in a dataframe using a fitted imputation model
Julia Equivalent: IAI.transform
Arguments
lnr: The learner or grid to use for imputationX: The features of the data.
Multi-task learners
iai::predict.supervised_multi_learner — Function
predict(obj, X, ...)Return the predictions made by a multi-task supervised learner for each point in the features
Julia Equivalent: IAI.predict and IAI.predict
Arguments
obj: The learner or grid to use for prediction.X: The features of the data....: Refer to the Julia documentation for available parameters.
iai::score.supervised_multi_learner — Function
score(obj, X, ...)Calculate the score for a multi-task model on the given data
Julia Equivalent: IAI.score and IAI.score
Arguments
obj: The learner or grid to evaluate.X: The features of the data....: Other parameters, including zero or more target vectors as required by the problem type. Refer to the Julia documentation for available parameters.
iai::predict_proba.classification_multi_learner — Function
predict_proba(obj, X, ...)Return the probabilities of class membership predicted by a multi-task classification learner for each point in the features
Julia Equivalent: IAI.predict_proba and IAI.predict_proba
Arguments
obj: The learner or grid to use for prediction.X: The features of the data....: Additional arguments (unused)
iai::roc_curve.classification_multi_learner — Function
roc_curve(obj, X, y, ...)Construct an ROC curve using a trained multi-task classification learner on the given data
Julia Equivalent: IAI.ROCCurve and IAI.ROCCurve
Arguments
obj: The learner or grid to use for prediction.X: The features of the data.y: The labels of the data....: Refer to the Julia documentation for available parameters.
Visualization
iai::write_html.abstract_visualization — Function
write_html(filename, obj, ...)Output an object as an interactive browser visualization in HTML format
Julia Equivalent: IAI.write_html
Arguments
filename: Where to save the output.obj: The object to output....: Refer to the Julia documentation for available parameters.
iai::show_in_browser.abstract_visualization — Function
show_in_browser(obj, ...)Show interactive visualization of an object in the default browser
Julia Equivalent: IAI.show_in_browser
Arguments
obj: The object to visualize....: Refer to the Julia documentation for available parameters.
iai::questionnaire — Function
questionnaire(obj, ...)Generic function for constructing an interactive questionnaire
Julia Equivalent: IAI.Questionnaire
Arguments
obj: The object controlling which method is used...: Arguments depending on the specific method used
iai::multi_questionnaire.default — Function
multi_questionnaire(obj, ...)Construct an interactive questionnaire from multiple specified learners
Refer to the documentation on advanced tree visualization for more information.
Julia Equivalent: IAI.MultiQuestionnaire
Arguments
obj: The questions to visualize. Refer to the Julia documentation on multi-learner visualizations for more information....: Additional arguments (unused)
iai::multi_questionnaire.grid_search — Function
multi_questionnaire(obj, ...)Construct an interactive tree questionnaire using multiple learners from the results of a grid search
Julia Equivalent: IAI.MultiQuestionnaire
Arguments
obj: The grid to visualize...: Additional arguments (unused)
Grid Search
iai::grid_search — Function
grid_search(lnr, ...)Controls grid search over parameter combinations
Julia Equivalent: IAI.GridSearch
Arguments
lnr: The learner to use when validating....: The parameters to validate over.
iai::fit.grid_search — Function
fit(obj, X, ...)Fits a grid_search to the training data
Julia Equivalent: IAI.fit!
Arguments
obj: The grid search to fit.X: The features of the data....: Other parameters, including zero or more target vectors as required by the problem type. Refer to the Julia documentation for available parameters.
iai::fit_cv — Function
fit_cv(grid, X, ...)Fits a grid search to the training data with cross-validation
Julia Equivalent: IAI.fit_cv!
Arguments
grid: The grid to fit.X: The features of the data....: Other parameters, including zero or more target vectors as required by the problem type. Refer to the Julia documentation for available parameters.
iai::fit_transform_cv — Function
fit_transform_cv(grid, X, ...)Train a grid using cross-validation with features and impute all missing values in these features
Julia Equivalent: IAI.fit_transform_cv!
Arguments
grid: The grid to use for imputationX: The features of the data....: Refer to the Julia documentation for available parameters.
iai::get_learner — Function
get_learner(grid)Return the fitted learner using the best parameter combination from a grid
Julia Equivalent: IAI.get_learner
Arguments
grid: The grid to query.
iai::get_best_params — Function
get_best_params(grid)Return the best parameter combination from a grid
Julia Equivalent: IAI.get_best_params
Arguments
grid: The grid search to query.
iai::get_grid_result_summary — Function
get_grid_result_summary(grid)Return a summary of the results from the grid search
Julia Equivalent: IAI.get_grid_result_summary
Arguments
grid: The grid search to query.
iai::get_grid_result_details — Function
get_grid_result_details(grid)Return a vector of lists detailing the results of the grid search
Julia Equivalent: IAI.get_grid_result_details
Arguments
grid: The grid search to query.
Tree Learners
General tree learners
iai::apply — Function
apply(lnr, X)Return the leaf index in a tree model into which each point in the features falls
Julia Equivalent: IAI.apply
Arguments
lnr: The learner or grid to query.X: The features of the data.
iai::apply_nodes — Function
apply_nodes(lnr, X)Return the indices of the points in the features that fall into each node of a trained tree model
Julia Equivalent: IAI.apply_nodes
Arguments
lnr: The learner or grid to query.X: The features of the data.
iai::decision_path — Function
decision_path(lnr, X)Return a matrix where entry (i, j) is true if the ith point in the features passes through the jth node in a trained tree model.
Julia Equivalent: IAI.decision_path
Arguments
lnr: The learner or grid to query.X: The features of the data.
iai::print_path — Function
print_path(lnr, X, ...)Print the decision path through the learner for each sample in the features
Julia Equivalent: IAI.print_path
Arguments
lnr: The learner or grid to query.X: The features of the data....: Refer to the Julia documentation for available parameters.
iai::variable_importance.tree_learner — Function
variable_importance(obj, ...)Generate a ranking of the variables in a tree learner according to their importance during training. The results are normalized so that they sum to one.
Julia Equivalent: IAI.variable_importance
Arguments
obj: The learner to query....: Refer to the Julia documentation for available parameters.
iai::get_num_nodes — Function
get_num_nodes(lnr)Return the number of nodes in a trained learner
Julia Equivalent: IAI.get_num_nodes
Arguments
lnr: The learner to query.
iai::get_depth — Function
get_depth(lnr, node_index)Get the depth of a node of a tree
Julia Equivalent: IAI.get_depth
Arguments
lnr: The learner to query.node_index: The node in the tree to query.
iai::get_parent — Function
get_parent(lnr, node_index)Get the index of the parent node at a node of a tree
Julia Equivalent: IAI.get_parent
Arguments
lnr: The learner to query.node_index: The node in the tree to query.
iai::get_lower_child — Function
get_lower_child(lnr, node_index)Get the index of the lower child at a split node of a tree
Julia Equivalent: IAI.get_lower_child
Arguments
lnr: The learner to query.node_index: The node in the tree to query.
iai::get_upper_child — Function
get_upper_child(lnr, node_index)Get the index of the upper child at a split node of a tree
Julia Equivalent: IAI.get_upper_child
Arguments
lnr: The learner to query.node_index: The node in the tree to query.
iai::get_num_samples — Function
get_num_samples(lnr, node_index)Get the number of training points contained in a node of a tree
Julia Equivalent: IAI.get_num_samples
Arguments
lnr: The learner to query.node_index: The node in the tree to query.
iai::is_categoric_split — Function
is_categoric_split(lnr, node_index)Check if a node of a tree applies a categoric split
Julia Equivalent: IAI.is_categoric_split
Arguments
lnr: The learner to query.node_index: The node in the tree to query.
iai::is_hyperplane_split — Function
is_hyperplane_split(lnr, node_index)Check if a node of a tree applies a hyperplane split
Julia Equivalent: IAI.is_hyperplane_split
Arguments
lnr: The learner to query.node_index: The node in the tree to query.
iai::is_leaf — Function
is_leaf(lnr, node_index)Check if a node of a tree is a leaf
Julia Equivalent: IAI.is_leaf
Arguments
lnr: The learner to query.node_index: The node in the tree to query.
iai::is_mixed_ordinal_split — Function
is_mixed_ordinal_split(lnr, node_index)Check if a node of a tree applies a mixed ordinal/categoric split
Julia Equivalent: IAI.is_mixed_ordinal_split
Arguments
lnr: The learner to query.node_index: The node in the tree to query.
iai::is_mixed_parallel_split — Function
is_mixed_parallel_split(lnr, node_index)Check if a node of a tree applies a mixed parallel/categoric split
Julia Equivalent: IAI.is_mixed_parallel_split
Arguments
lnr: The learner to query.node_index: The node in the tree to query.
iai::is_ordinal_split — Function
is_ordinal_split(lnr, node_index)Check if a node of a tree applies a ordinal split
Julia Equivalent: IAI.is_ordinal_split
Arguments
lnr: The learner to query.node_index: The node in the tree to query.
iai::is_parallel_split — Function
is_parallel_split(lnr, node_index)Check if a node of a tree applies a parallel split
Julia Equivalent: IAI.is_parallel_split
Arguments
lnr: The learner to query.node_index: The node in the tree to query.
iai::get_split_categories — Function
get_split_categories(lnr, node_index)Return the categoric/ordinal information used in the split at a node of a tree
Julia Equivalent: IAI.get_split_categories
Arguments
lnr: The learner to query.node_index: The node in the tree to query.
iai::get_split_feature — Function
get_split_feature(lnr, node_index)Return the feature used in the split at a node of a tree
Julia Equivalent: IAI.get_split_feature
Arguments
lnr: The learner to query.node_index: The node in the tree to query.
iai::get_split_threshold — Function
get_split_threshold(lnr, node_index)Return the threshold used in the split at a node of a tree
Julia Equivalent: IAI.get_split_threshold
Arguments
lnr: The learner to query.node_index: The node in the tree to query.
iai::get_split_weights — Function
get_split_weights(lnr, node_index)Return the weights for numeric and categoric features used in the hyperplane split at a node of a tree
Julia Equivalent: IAI.get_split_weights
Arguments
lnr: The learner to query.node_index: The node in the tree to query.
iai::missing_goes_lower — Function
missing_goes_lower(lnr, node_index)Check if points with missing values go to the lower child at a split node of of a tree
Julia Equivalent: IAI.missing_goes_lower
Arguments
lnr: The learner to query.node_index: The node in the tree to query.
Classification tree learners
iai::get_classification_label.classification_tree_learner — Function
get_classification_label(obj, node_index, ...)Return the predicted label at a node of a tree
Julia Equivalent: IAI.get_classification_label
Arguments
obj: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
iai::get_classification_proba.classification_tree_learner — Function
get_classification_proba(obj, node_index, ...)Return the predicted probabilities of class membership at a node of a tree
Julia Equivalent: IAI.get_classification_proba
Arguments
obj: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
iai::get_regression_constant.classification_tree_learner — Function
get_regression_constant(obj, node_index, ...)Return the constant term in the logistic regression prediction at a node of a classification tree
Julia Equivalent: IAI.get_regression_constant
Arguments
obj: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
iai::get_regression_weights.classification_tree_learner — Function
get_regression_weights(obj, node_index, ...)Return the weights for each feature in the logistic regression prediction at a node of a classification tree
Julia Equivalent: IAI.get_regression_weights
Arguments
obj: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
iai::set_threshold — Function
set_threshold(lnr, label, threshold, ...)For a binary classification problem, update the the predicted labels in the leaves of the learner to predict a label only if the predicted probability is at least the specified threshold.
Julia Equivalent: IAI.set_threshold!
Arguments
lnr: The learner to modify.label: The referenced label.threshold: The probability threshold above whichlabelwill be be predicted....: Refer to the Julia documentation for available parameters.
iai::set_display_label — Function
set_display_label(lnr, display_label)Show the probability of a specified label when visualizing a learner
Julia Equivalent: IAI.set_display_label!
Arguments
lnr: The learner to modify.display_label: The label for which to show probabilities.
iai::reset_display_label — Function
reset_display_label(lnr)Reset the predicted probability displayed to be that of the predicted label when visualizing a learner
Julia Equivalent: IAI.reset_display_label!
Arguments
lnr: The learner to modify.
Regression tree learners
iai::get_regression_constant.regression_tree_learner — Function
get_regression_constant(obj, node_index, ...)Return the constant term in the linear regression prediction at a node of a regression tree
Julia Equivalent: IAI.get_regression_constant
Arguments
obj: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
iai::get_regression_weights.regression_tree_learner — Function
get_regression_weights(obj, node_index, ...)Return the weights for each feature in the linear regression prediction at a node of a regression tree
Julia Equivalent: IAI.get_regression_weights
Arguments
obj: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
Survival tree learners
iai::get_survival_curve — Function
get_survival_curve(lnr, node_index, ...)Return the survival curve at a node of a tree
Julia Equivalent: IAI.get_survival_curve
Arguments
lnr: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
iai::get_survival_expected_time — Function
get_survival_expected_time(lnr, node_index, ...)Return the predicted expected survival time at a node of a tree
Julia Equivalent: IAI.get_survival_expected_time
Arguments
lnr: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
iai::get_survival_hazard — Function
get_survival_hazard(lnr, node_index, ...)Return the predicted hazard ratio at a node of a tree
Julia Equivalent: IAI.get_survival_hazard
Arguments
lnr: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
iai::get_regression_constant.survival_tree_learner — Function
get_regression_constant(obj, node_index, ...)Return the constant term in the cox regression prediction at a node of a survival tree
Julia Equivalent: IAI.get_regression_constant
Arguments
obj: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
iai::get_regression_weights.survival_tree_learner — Function
get_regression_weights(obj, node_index, ...)Return the weights for each feature in the cox regression prediction at a node of a survival tree
Julia Equivalent: IAI.get_regression_weights
Arguments
obj: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
Prescription tree learners
iai::get_prescription_treatment_rank — Function
get_prescription_treatment_rank(lnr, node_index, ...)Return the treatments ordered from most effective to least effective at a node of a tree
Julia Equivalent: IAI.get_prescription_treatment_rank
Arguments
lnr: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
iai::get_regression_constant.prescription_tree_learner — Function
get_regression_constant(obj, node_index, treatment, ...)Return the constant term in the linear regression prediction at a node of a prescription tree
Julia Equivalent: IAI.get_regression_constant
Arguments
obj: The learner to query.node_index: The node in the tree to query.treatment: The treatment to query....: Refer to the Julia documentation for available parameters.
iai::get_regression_weights.prescription_tree_learner — Function
get_regression_weights(obj, node_index, treatment, ...)Return the weights for each feature in the linear regression prediction at a node of a prescription tree
Julia Equivalent: IAI.get_regression_weights
Arguments
obj: The learner to query.node_index: The node in the tree to query.treatment: The treatment to query....: Refer to the Julia documentation for available parameters.
Policy tree learners
iai::get_policy_treatment_rank — Function
get_policy_treatment_rank(lnr, node_index, ...)Return the treatments ordered from most effective to least effective at a node of a tree
Julia Equivalent: IAI.get_policy_treatment_rank
Arguments
lnr: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
iai::get_policy_treatment_outcome — Function
get_policy_treatment_outcome(lnr, node_index, ...)Return the quality of the treatments at a node of a tree
Julia Equivalent: IAI.get_policy_treatment_outcome
Arguments
lnr: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
iai::get_policy_treatment_outcome_standard_error — Function
get_policy_treatment_outcome_standard_error(lnr, node_index, ...)Return the standard error for the quality of the treatments at a node of a tree
Julia Equivalent: IAI.get_policy_treatment_outcome_standard_error
Arguments
lnr: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
Multi-task learners
iai::get_classification_label.classification_tree_multi_learner — Function
get_classification_label(obj, node_index, ...)Return the predicted label at a node of a multi-task tree
Julia Equivalent: IAI.get_classification_label and IAI.get_classification_label
Arguments
obj: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
iai::get_classification_proba.classification_tree_multi_learner — Function
get_classification_proba(obj, node_index, ...)Return the predicted probabilities of class membership at a node of a multi-task tree
Julia Equivalent: IAI.get_classification_proba and IAI.get_classification_proba
Arguments
obj: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
iai::get_regression_constant.classification_tree_multi_learner — Function
get_regression_constant(obj, node_index, ...)Return the constant term in the logistic regression prediction at a node of a multi-task classification tree
Julia Equivalent: IAI.get_regression_constant and IAI.get_regression_constant
Arguments
obj: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
iai::get_regression_weights.classification_tree_multi_learner — Function
get_regression_weights(obj, node_index, ...)Return the weights for each feature in the logistic regression prediction at a node of a multi-task classification tree
Julia Equivalent: IAI.get_regression_weights and IAI.get_regression_weights
Arguments
obj: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
iai::get_regression_constant.regression_tree_multi_learner — Function
get_regression_constant(obj, node_index, ...)Return the constant term in the linear regression prediction at a node of a multi-task regression tree
Julia Equivalent: IAI.get_regression_constant and IAI.get_regression_constant
Arguments
obj: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
iai::get_regression_weights.regression_tree_multi_learner — Function
get_regression_weights(obj, node_index, ...)Return the weights for each feature in the linear regression prediction at a node of a multi-task regression tree
Julia Equivalent: IAI.get_regression_weights and IAI.get_regression_weights
Arguments
obj: The learner to query.node_index: The node in the tree to query....: Refer to the Julia documentation for available parameters.
Tree learner visualization
iai::write_png — Function
write_png(filename, lnr, ...)Output a learner as a PNG image
Before using this function, either run load_graphviz or ensure that Graphviz is installed and on the system PATH
Julia Equivalent: IAI.write_png
Arguments
filename: Where to save the output.lnr: The learner to output....: Refer to the Julia documentation for available parameters.
iai::write_pdf — Function
write_pdf(filename, lnr, ...)Output a learner as a PDF image
Before using this function, either run load_graphviz or ensure that Graphviz is installed and on the system PATH
Julia Equivalent: IAI.write_pdf
Arguments
filename: Where to save the output.lnr: The learner to output....: Refer to the Julia documentation for available parameters.
iai::write_svg — Function
write_svg(filename, lnr, ...)Output a learner as a SVG image
Before using this function, either run load_graphviz or ensure that Graphviz is installed and on the system PATH
Julia Equivalent: IAI.write_svg
Arguments
filename: Where to save the output.lnr: The learner to output....: Refer to the Julia documentation for available parameters.
iai::write_dot — Function
write_dot(filename, lnr, ...)Output a learner in .dot format
Julia Equivalent: IAI.write_dot
Arguments
filename: Where to save the output.lnr: The learner to output....: Refer to the Julia documentation for available parameters.
iai::tree_plot — Function
tree_plot(lnr, ...)Specify an interactive tree visualization of a tree learner
Julia Equivalent: IAI.TreePlot
Arguments
lnr: The learner to visualize....: Refer to the Julia documentation on advanced tree visualization for available parameters.
iai::write_html.tree_learner — Function
write_html(filename, obj, ...)Output a tree learner as an interactive browser visualization in HTML format
Julia Equivalent: IAI.write_html
Arguments
filename: Where to save the output.obj: The learner or grid to output....: Refer to the Julia documentation for available parameters.
iai::show_in_browser.tree_learner — Function
show_in_browser(obj, ...)Show interactive tree visualization of a tree learner in the default browser
Julia Equivalent: IAI.show_in_browser
Arguments
obj: The learner or grid to visualize....: Refer to the Julia documentation for available parameters.
iai::questionnaire.tree_learner — Function
questionnaire(obj, ...)Specify an interactive questionnaire of a tree learner
Julia Equivalent: IAI.Questionnaire
Arguments
obj: The learner to visualize....: Refer to the Julia documentation for available parameters.
iai::write_questionnaire.tree_learner — Function
write_questionnaire(filename, obj, ...)Output a tree learner as an interactive questionnaire in HTML format
Julia Equivalent: IAI.write_questionnaire
Arguments
filename: Where to save the output.obj: The learner or grid to output....: Refer to the Julia documentation for available parameters.
iai::show_questionnaire.tree_learner — Function
show_questionnaire(obj, ...)Show an interactive questionnaire based on a tree learner in default browser
Julia Equivalent: IAI.show_questionnaire
Arguments
obj: The learner or grid to visualize....: Refer to the Julia documentation for available parameters.
iai::multi_tree_plot.default — Function
multi_tree_plot(obj, ...)Construct an interactive tree visualization of multiple tree learners as specified by questions
Refer to the documentation on advanced tree visualization for more information.
Julia Equivalent: IAI.MultiTreePlot
Arguments
obj: The questions to visualize. Refer to the Julia documentation on multi-learner visualizations for more information....: Additional arguments (unused)
iai::multi_tree_plot.grid_search — Function
multi_tree_plot(obj, ...)Construct an interactive tree visualization of multiple tree learners from the results of a grid search
Julia Equivalent: IAI.MultiTreePlot
Arguments
obj: The grid to visualize...: Additional arguments (unused)
Tree Stability
iai::get_tree — Function
get_tree(lnr, index)Return a copy of the learner that uses a specific tree rather than the tree with the best training objective.
Julia Equivalent: IAI.get_tree
Arguments
lnr: The original learnerindex: The index of the tree to use
Stability Analysis
iai::stability_analysis — Function
stability_analysis(lnr, ...)Conduct a stability analysis of the trees in a tree learner
Refer to the documentation on tree stability for more information.
Julia Equivalent: IAI.StabilityAnalysis
Arguments
lnr: The original learner...: Additional arguments (refer to Julia documentation)
iai::get_stability_results — Function
get_stability_results(stability)Return the trained trees in order of increasing objective value, along with their variable importance scores for each feature
Julia Equivalent: IAI.get_stability_results
Arguments
stability: The stability analysis to query
iai::get_cluster_distances — Function
get_cluster_distances(stability, num_trees)Return the distances between the centroids of each pair of clusters, under the clustering of a given number of trees
Julia Equivalent: IAI.get_cluster_distances
Arguments
stability: The stability analysis to querynum_trees: The number of trees to include in the clustering
iai::get_cluster_assignments — Function
get_cluster_assignments(stability, num_trees)Return the indices of the trees assigned to each cluster, under the clustering of a given number of trees
Julia Equivalent: IAI.get_cluster_assignments
Arguments
stability: The stability analysis to querynum_trees: The number of trees to include in the clustering
iai::get_cluster_details — Function
get_cluster_details(stability, num_trees)Return the centroid information for each cluster, under the clustering of a given number of trees
Julia Equivalent: IAI.get_cluster_details
Arguments
stability: The stability analysis to querynum_trees: The number of trees to include in the clustering
plot.stability_analysis — Function
ggplot2::autoplot.stability_analysis — Function
ggplot2::autoplot(object, ...)Construct a ggplot2::ggplot object plotting the results of the stability analysis
Arguments
object: The stability analysis to plot...: Additional arguments (unused)
Similarity Comparison
iai::variable_importance_similarity — Function
variable_importance_similarity(lnr, new_lnr, ...)Calculate similarity between the final tree in a tree learner with all trees in new tree learner using variable importance scores.
Julia Equivalent: IAI.variable_importance_similarity
Arguments
lnr: The original learnernew_lnr: The new learner...: Additional arguments (refer to Julia documentation)
iai::similarity_comparison — Function
similarity_comparison(lnr, new_lnr, deviations)Conduct a similarity comparison between the final tree in a learner and all trees in a new learner to consider the tradeoff between training performance and similarity to the original tree
Refer to the documentation on tree stability for more information.
Julia Equivalent: IAI.SimilarityComparison
Arguments
lnr: The original learnernew_lnr: The new learnerdeviations: The deviation between the original tree and each tree in the new learner
iai::get_train_errors — Function
get_train_errors(similarity)Extract the training objective value for each candidate tree in the comparison, where a lower value indicates a better solution
Julia Equivalent: IAI.get_train_errors
Arguments
similarity: The similarity comparison
plot.similarity_comparison — Function
ggplot2::autoplot.similarity_comparison — Function
ggplot2::autoplot(object, ...)Construct a ggplot2::ggplot object plotting the results of the similarity comparison
Arguments
object: The similarity comparison to plot...: Additional arguments (unused)
Optimal Trees
iai::optimal_tree_classifier — Function
optimal_tree_classifier(...)Learner for training Optimal Classification Trees
Julia Equivalent: IAI.OptimalTreeClassifier
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::optimal_tree_regressor — Function
optimal_tree_regressor(...)Learner for training Optimal Regression Trees
Julia Equivalent: IAI.OptimalTreeRegressor
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::optimal_tree_survival_learner — Function
optimal_tree_survival_learner(...)Learner for training Optimal Survival Trees
Julia Equivalent: IAI.OptimalTreeSurvivalLearner
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::optimal_tree_prescription_minimizer — Function
optimal_tree_prescription_minimizer(...)Learner for training Optimal Prescriptive Trees where the prescriptions should aim to minimize outcomes
Julia Equivalent: IAI.OptimalTreePrescriptionMinimizer
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::optimal_tree_prescription_maximizer — Function
optimal_tree_prescription_maximizer(...)Learner for training Optimal Prescriptive Trees where the prescriptions should aim to maximize outcomes
Julia Equivalent: IAI.OptimalTreePrescriptionMaximizer
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::optimal_tree_policy_minimizer — Function
optimal_tree_policy_minimizer(...)Learner for training Optimal Policy Trees where the policy should aim to minimize outcomes
Julia Equivalent: IAI.OptimalTreePolicyMinimizer
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::optimal_tree_policy_maximizer — Function
optimal_tree_policy_maximizer(...)Learner for training Optimal Policy Trees where the policy should aim to maximize outcomes
Julia Equivalent: IAI.OptimalTreePolicyMaximizer
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::optimal_tree_multi_classifier — Function
optimal_tree_multi_classifier(...)Learner for training multi-task Optimal Classification Trees
Julia Equivalent: IAI.OptimalTreeMultiClassifier
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::optimal_tree_multi_regressor — Function
optimal_tree_multi_regressor(...)Learner for training multi-task Optimal Regression Trees
Julia Equivalent: IAI.OptimalTreeMultiRegressor
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::refit_leaves — Function
refit_leaves(lnr, ...)Refit the models in the leaves of a trained learner using the supplied data
Julia Equivalent: IAI.refit_leaves!
Arguments
lnr: The learner to refit...: Refer to the Julia documentation for available parameters
iai::copy_splits_and_refit_leaves — Function
copy_splits_and_refit_leaves(new_lnr, orig_lnr, ...)Copy the tree split structure from one learner into another and refit the models in each leaf of the tree using the supplied data
Julia Equivalent: IAI.copy_splits_and_refit_leaves!
Arguments
new_lnr: The learner to modify and refitorig_lnr: The learner from which to copy the tree split structure...: Refer to the Julia documentation for available parameters
iai::prune_trees — Function
prune_trees(lnr, ...)Use the trained trees in a learner along with the supplied validation data to determine the best value for the cp parameter and then prune the trees according to this value
Julia Equivalent: IAI.prune_trees!
Arguments
lnr: The learner to prune...: Refer to the Julia documentation for available parameters
OptImpute
iai::impute — Function
impute(X, ...)Impute missing values using either a specified method or through validation
Julia Equivalent: IAI.impute
This function was deprecated in iai 1.7.0. This is for consistency with the IAI v3.0.0 Julia release.
Arguments
X: The dataframe in which to impute missing values....: Refer to the Julia documentation for available parameters.
iai::impute_cv — Function
impute_cv(X, ...)Impute missing values using cross validation
Julia Equivalent: IAI.impute_cv
This function was deprecated in iai 1.7.0. This is for consistency with the IAI v3.0.0 Julia release.
Arguments
X: The dataframe in which to impute missing values....: Refer to the Julia documentation for available parameters.
iai::imputation_learner — Function
imputation_learner(method = "opt_knn", ...)Generic learner for imputing missing values
Julia Equivalent: IAI.ImputationLearner
Arguments
method: (optional) Specifies the imputation method to use....: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::opt_knn_imputation_learner — Function
opt_knn_imputation_learner(...)Learner for conducting optimal k-NN imputation
Julia Equivalent: IAI.OptKNNImputationLearner
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::opt_svm_imputation_learner — Function
opt_svm_imputation_learner(...)Learner for conducting optimal SVM imputation
Julia Equivalent: IAI.OptSVMImputationLearner
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::opt_tree_imputation_learner — Function
opt_tree_imputation_learner(...)Learner for conducting optimal tree-based imputation
Julia Equivalent: IAI.OptTreeImputationLearner
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::single_knn_imputation_learner — Function
single_knn_imputation_learner(...)Learner for conducting heuristic k-NN imputation
Julia Equivalent: IAI.SingleKNNImputationLearner
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::mean_imputation_learner — Function
mean_imputation_learner(...)Learner for conducting mean imputation
Julia Equivalent: IAI.MeanImputationLearner
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::rand_imputation_learner — Function
rand_imputation_learner(...)Learner for conducting random imputation
Julia Equivalent: IAI.RandImputationLearner
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::zero_imputation_learner — Function
zero_imputation_learner(...)Learner for conducting zero-imputation
Julia Equivalent: IAI.ZeroImputationLearner
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::fit_and_expand — Function
fit_and_expand(lnr, X, ...)Fit an imputation learner with training features and create adaptive indicator features to encode the missing pattern
Julia Equivalent: IAI.fit_and_expand!
Arguments
lnr: The learner to use for imputation.X: The dataframe in which to impute missing values....: Refer to the Julia documentation for available parameters.
iai::transform_and_expand — Function
transform_and_expand(lnr, X, ...)Transform features with a trained imputation learner and create adaptive indicator features to encode the missing pattern
Julia Equivalent: IAI.transform_and_expand
Arguments
lnr: The learner to use for imputation.X: The dataframe in which to impute missing values....: Refer to the Julia documentation for available parameters.
Optimal Feature Selection
iai::optimal_feature_selection_classifier — Function
optimal_feature_selection_classifier(...)Learner for conducting Optimal Feature Selection on classification problems
Julia Equivalent: IAI.OptimalFeatureSelectionClassifier
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::optimal_feature_selection_regressor — Function
optimal_feature_selection_regressor(...)Learner for conducting Optimal Feature Selection on regression problems
Julia Equivalent: IAI.OptimalFeatureSelectionRegressor
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::fit.optimal_feature_selection_learner — Function
fit(obj, X, ...)Fits an Optimal Feature Selection learner to the training data
When the coordinated_sparsity parameter of the learner is TRUE, additional keyword arguments are required - please refer to the Julia documentation.
Julia Equivalent: IAI.fit!
Arguments
obj: The learner or grid to fit.X: The features of the data....: Other parameters, including zero or more target vectors as required by the problem type. Refer to the Julia documentation for available parameters.
iai::predict.optimal_feature_selection_learner — Function
predict(obj, X, fit_index = NULL, ...)Return the predictions made by an Optimal Feature Selection learner for each point in the features
Julia Equivalent: IAI.predict
Arguments
obj: The learner or grid to use for prediction.X: The features of the data.fit_index: The index of the cluster to use for prediction, if thecoordinated_sparsityparameter on the learner isTRUE....: Refer to the Julia documentation for available parameters.
iai::score.optimal_feature_selection_learner — Function
score(obj, X, ...)Calculate the score for an Optimal Feature Selection learner on the given data
Julia Equivalent: IAI.score
Arguments
obj: The learner or grid to evaluate.X: The features of the data....: Other parameters, including zero or more target vectors as required by the problem type. If thecoordinated_sparsityparameter on the learner isTRUE, thenfit_indexmust be used to specify which cluster should be used. Refer to the Julia documentation for available parameters.
iai::variable_importance.optimal_feature_selection_learner — Function
variable_importance(obj, fit_index = NULL, ...)Generate a ranking of the variables in an Optimal Feature Selection learner according to their importance during training. The results are normalized so that they sum to one.
Julia Equivalent: IAI.variable_importance
Arguments
obj: The learner to query.fit_index: The index of the cluster to use for prediction, if thecoordinated_sparsityparameter on the learner isTRUE....: Refer to the Julia documentation for available parameters.
iai::get_prediction_constant.optimal_feature_selection_learner — Function
get_prediction_constant(obj, fit_index = NULL, ...)Return the constant term in the prediction in a trained Optimal Feature Selection learner
Julia Equivalent: IAI.get_prediction_constant
Arguments
obj: The learner to query.fit_index: The index of the cluster to use for prediction, if thecoordinated_sparsityparameter on the learner isTRUE....: Additional arguments (unused)
iai::get_prediction_weights.optimal_feature_selection_learner — Function
get_prediction_weights(obj, fit_index = NULL, ...)Return the weights for numeric and categoric features used for prediction in a trained Optimal Feature Selection learner
Julia Equivalent: IAI.get_prediction_weights
Arguments
obj: The learner to query.fit_index: The index of the cluster to use for prediction, if thecoordinated_sparsityparameter on the learner isTRUE....: Additional arguments (unused)
iai::questionnaire.optimal_feature_selection_learner — Function
questionnaire(obj, ...)Specify an interactive questionnaire of an Optimal Feature Selection learner
Julia Equivalent: IAI.Questionnaire
Arguments
obj: The learner to visualize....: Refer to the Julia documentation for available parameters.
iai::write_questionnaire.optimal_feature_selection_learner — Function
write_questionnaire(filename, obj, ...)Output an Optimal Feature Selection learner as an interactive questionnaire in HTML format
Julia Equivalent: IAI.write_questionnaire
Arguments
filename: Where to save the output.obj: The learner or grid to output....: Refer to the Julia documentation for available parameters.
iai::show_questionnaire.optimal_feature_selection_learner — Function
show_questionnaire(obj, ...)Show an interactive questionnaire based on an Optimal Feature Selection learner in default browser
Julia Equivalent: IAI.show_questionnaire
Arguments
obj: The learner or grid to visualize....: Refer to the Julia documentation for available parameters.
plot.grid_search — Function
plot(x, ...)Plot a grid search results for Optimal Feature Selection learners
Arguments
x: The grid search to plot...: Additional arguments (passed toautoplot.grid_search)
ggplot2::autoplot.grid_search — Function
ggplot2::autoplot(object, type = stop("`type` is required"), ...)Construct a ggplot2::ggplot object plotting grid search results for Optimal Feature Selection learners
Arguments
object: The grid search to plottype: The type of plot to construct (either"validation"or"importance", for more information refer to the Julia documentation for plotting grid search results )...: Additional arguments (unused)
iai::get_num_fits.optimal_feature_selection_learner — Function
get_num_fits(obj, ...)Return the number of fits along the path in a trained Optimal Feature Selection learner
Julia Equivalent: IAI.get_num_fits
Arguments
obj: The Optimal Feature Selection learner to query....: Additional arguments (unused)
Reward Estimation
iai::fit_predict — Function
fit_predict(obj, ...)Generic function for fitting a reward estimator on features, treatments and returning predicted counterfactual rewards and scores of the internal estimators.
Julia Equivalent: IAI.fit_predict!
Arguments
obj: The object controlling which method is used...: Arguments depending on the specific method used
Categorical Treatments
iai::categorical_classification_reward_estimator — Function
categorical_classification_reward_estimator(...)Learner for conducting reward estimation with categorical treatments and classification outcomes
Julia Equivalent: IAI.CategoricalClassificationRewardEstimator
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::categorical_regression_reward_estimator — Function
categorical_regression_reward_estimator(...)Learner for conducting reward estimation with categorical treatments and regression outcomes
Julia Equivalent: IAI.CategoricalRegressionRewardEstimator
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::categorical_survival_reward_estimator — Function
categorical_survival_reward_estimator(...)Learner for conducting reward estimation with categorical treatments and survival outcomes
Julia Equivalent: IAI.CategoricalSurvivalRewardEstimator
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::fit_predict.categorical_reward_estimator — Function
fit_predict(obj, X, treatments, ...)Fit a categorical reward estimator on features, treatments and outcomes and return predicted counterfactual rewards for each observation, under each treatment observed in the data, as well as the scores of the internal estimators.
Julia Equivalent: IAI.fit_predict!
Arguments
obj: The learner or grid to use for estimationX: The features of the data.treatments: The treatment applied to each point in the data....: Additional arguments depending on the treatment and outcome types. Refer to the Julia documentation for more information.
iai::predict.categorical_reward_estimator — Function
predict(obj, X, ...)Return counterfactual rewards estimated by a categorical reward estimator for each observation in the supplied data
Julia Equivalent: IAI.predict
Arguments
obj: The learner or grid to use for estimationX: The features of the data....: Additional arguments depending on the treatment and outcome types. Refer to the Julia documentation for more information.
iai::score.categorical_reward_estimator — Function
score(obj, X, ...)Calculate the scores for a categorical reward estimator on the given data
Julia Equivalent: IAI.score
Arguments
obj: The learner or grid to evaluate.X: The features of the data....: Other parameters, including zero or more target vectors as required by the problem type. Refer to the Julia documentation for other available parameters.
iai::predict_reward.categorical_reward_estimator — Function
predict_reward(obj, X, ...)Return counterfactual rewards estimated by a categorical reward estimator for each observation in the supplied data and predictions
Julia Equivalent: IAI.predict_reward
Arguments
obj: The learner or grid to use for estimationX: The features of the data....: Additional arguments depending on the treatment and outcome types. Refer to the Julia documentation for more information.
iai::equal_propensity_estimator — Function
equal_propensity_estimator(...)Learner that estimates equal propensity for all treatments.
For use with data from randomized experiments where treatments are known to be randomly assigned.
Julia Equivalent: IAI.EqualPropensityEstimator
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
Numeric Treatments
iai::numeric_classification_reward_estimator — Function
numeric_classification_reward_estimator(...)Learner for conducting reward estimation with numeric treatments and classification outcomes
Julia Equivalent: IAI.NumericClassificationRewardEstimator
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::numeric_regression_reward_estimator — Function
numeric_regression_reward_estimator(...)Learner for conducting reward estimation with numeric treatments and regression outcomes
Julia Equivalent: IAI.NumericRegressionRewardEstimator
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::numeric_survival_reward_estimator — Function
numeric_survival_reward_estimator(...)Learner for conducting reward estimation with numeric treatments and survival outcomes
Julia Equivalent: IAI.NumericSurvivalRewardEstimator
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::get_estimation_densities — Function
get_estimation_densities(lnr, ...)Return the total kernel density surrounding each treatment candidate for the propensity/outcome estimation problems in a fitted learner.
Julia Equivalent: IAI.get_estimation_densities
Arguments
lnr: The learner from which to extract densities...: Refer to the Julia documentation for other parameters
iai::tune_reward_kernel_bandwidth — Function
tune_reward_kernel_bandwidth(lnr, ...)Conduct the reward kernel bandwidth tuning procedure for a range of starting bandwidths and return the final tuned values.
Julia Equivalent: IAI.tune_reward_kernel_bandwidth
Arguments
lnr: The learner to use for tuning the bandwidth...: Refer to the Julia documentation for other parameters
iai::set_reward_kernel_bandwidth — Function
set_reward_kernel_bandwidth(lnr, ...)Save a new reward kernel bandwidth inside a learner, and return new reward predictions generated using this bandwidth for the original data used to train the learner.
Julia Equivalent: IAI.set_reward_kernel_bandwidth!
Arguments
lnr: The learner to modify...: Refer to the Julia documentation for available parameters.
iai::fit_predict.numeric_reward_estimator — Function
fit_predict(obj, X, treatments, ...)Fit a numeric reward estimator on features, treatments and outcomes and return predicted counterfactual rewards for each observation, under each treatment candidate, as well as the scores of the internal estimators.
Julia Equivalent: IAI.fit_predict!
Arguments
obj: The learner or grid to use for estimationX: The features of the data.treatments: The treatment applied to each point in the data....: Additional arguments depending on the treatment and outcome types. Refer to the Julia documentation for more information.
iai::predict.numeric_reward_estimator — Function
predict(obj, X, ...)Return counterfactual rewards estimated by a numeric reward estimator for each observation in the supplied data
Julia Equivalent: IAI.predict
Arguments
obj: The learner or grid to use for estimationX: The features of the data....: Additional arguments depending on the treatment and outcome types. Refer to the Julia documentation for more information.
iai::score.numeric_reward_estimator — Function
score(obj, X, ...)Calculate the scores for a numeric reward estimator on the given data
Julia Equivalent: IAI.score
Arguments
obj: The learner or grid to evaluate.X: The features of the data....: Other parameters, including zero or more target vectors as required by the problem type. Refer to the Julia documentation for other available parameters.
iai::predict_reward.numeric_reward_estimator — Function
predict_reward(obj, X, ...)Return counterfactual rewards estimated by a numeric reward estimator for each observation in the supplied data and predictions
Julia Equivalent: IAI.predict_reward
Arguments
obj: The learner or grid to use for estimationX: The features of the data....: Additional arguments depending on the treatment and outcome types. Refer to the Julia documentation for more information.
iai::all_treatment_combinations — Function
all_treatment_combinations(...)Return a dataframe containing all treatment combinations of one or more treatment vectors, ready for use as treatment candidates in fit_predict! or predict
Julia Equivalent: IAI.all_treatment_combinations
Arguments
...: A vector of possible options for each treatment
iai::convert_treatments_to_numeric — Function
convert_treatments_to_numeric(treatments)Convert treatments from symbol/string format into numeric values.
Julia Equivalent: IAI.convert_treatments_to_numeric
Arguments
treatments: The treatments to convert
Heuristics
Random Forests
iai::random_forest_classifier — Function
random_forest_classifier(...)Learner for training random forests for classification problems
Julia Equivalent: IAI.RandomForestClassifier
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::random_forest_regressor — Function
random_forest_regressor(...)Learner for training random forests for regression problems
Julia Equivalent: IAI.RandomForestRegressor
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::random_forest_survival_learner — Function
random_forest_survival_learner(...)Learner for training random forests for survival problems
Julia Equivalent: IAI.RandomForestSurvivalLearner
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
XGBoost
iai::xgboost_classifier — Function
xgboost_classifier(...)Learner for training XGBoost models for classification problems
Julia Equivalent: IAI.XGBoostClassifier
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::xgboost_regressor — Function
xgboost_regressor(...)Learner for training XGBoost models for regression problems
Julia Equivalent: IAI.XGBoostRegressor
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::xgboost_survival_learner — Function
xgboost_survival_learner(...)Learner for training XGBoost models for survival problems
Julia Equivalent: IAI.XGBoostSurvivalLearner
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::predict_shap — Function
predict_shap(lnr, X)Calculate SHAP values for all points in the features using the learner
Julia Equivalent: IAI.predict_shap
Arguments
lnr: The XGBoost learner or grid to use for prediction.X: The features of the data.
iai::write_booster — Function
write_booster(filename, lnr)Write the internal booster saved in the learner to file
Julia Equivalent: IAI.write_booster
Arguments
filename: Where to save the output.lnr: The XGBoost learner with the booster to output.
GLMNet
iai::glmnetcv_classifier — Function
glmnetcv_classifier(...)Learner for training GLMNet models for classification problems with cross-validation
Julia Equivalent: IAI.GLMNetCVClassifier
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::predict_proba.glmnetcv_classifier — Function
predict_proba(obj, X, fit_index = NULL, ...)Return the probabilities of class membership predicted by a glmnetcv_classifier learner for each point in the features
Julia Equivalent: IAI.predict_proba
Arguments
obj: The learner or grid to use for prediction.X: The features of the data.fit_index: The index of the fit in the path to use for prediction, defaulting to the best fit if not supplied....: Additional arguments (unused)
iai::roc_curve.glmnetcv_classifier — Function
roc_curve(obj, X, y, fit_index = NULL, ...)Construct an ROC curve using a trained glmnetcv_classifier on the given data
Julia Equivalent: IAI.ROCCurve
Arguments
obj: The learner or grid to use for prediction.X: The features of the data.y: The labels of the data.fit_index: The index of the fit in the path to use for prediction, defaulting to the best fit if not supplied....: Refer to the Julia documentation for available parameters.
iai::glmnetcv_regressor — Function
glmnetcv_regressor(...)Learner for training GLMNet models for regression problems with cross-validation
Julia Equivalent: IAI.GLMNetCVRegressor
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::glmnetcv_survival_learner — Function
glmnetcv_survival_learner(...)Learner for training GLMNet models for survival problems with cross-validation
Julia Equivalent: IAI.GLMNetCVSurvivalLearner
Arguments
...: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
iai::predict_expected_survival_time.glmnetcv_survival_learner — Function
predict_expected_survival_time(obj, X, fit_index = NULL, ...)Return the expected survival time estimate made by a glmnetcv_survival_learner for each point in the features.
Julia Equivalent: IAI.predict_expected_survival_time
Arguments
obj: The learner or grid to use for prediction.X: The features of the data.fit_index: The index of the fit in the path to use for prediction, defaulting to the best fit if not supplied....: Additional arguments (unused)
iai::predict_hazard.glmnetcv_survival_learner — Function
predict_hazard(obj, X, fit_index = NULL, ...)Return the fitted hazard coefficient estimate made by a glmnetcv_survival_learner for each point in the features.
A higher hazard coefficient estimate corresponds to a smaller predicted survival time.
Julia Equivalent: IAI.predict_hazard
Arguments
obj: The learner or grid to use for prediction.X: The features of the data.fit_index: The index of the fit in the path to use for prediction, defaulting to the best fit if not supplied....: Additional arguments (unused)
iai::predict.glmnetcv_learner — Function
predict(obj, X, fit_index = NULL, ...)Return the predictions made by a GLMNet learner for each point in the features
Julia Equivalent: IAI.predict
Arguments
obj: The learner or grid to use for prediction.X: The features of the data.fit_index: The index of the fit in the path to use for prediction, defaulting to the best fit if not supplied....: Refer to the Julia documentation for available parameters.
iai::score.glmnetcv_learner — Function
score(obj, X, ...)Calculate the score for a GLMNet learner on the given data
Julia Equivalent: IAI.score
Arguments
obj: The learner or grid to evaluate.X: The features of the data....: Other parameters, including zero or more target vectors as required by the problem type.fit_indexcan be used to specify the index of the fit in the path to use for prediction, defaulting to the best fit if not supplied. Refer to the Julia documentation for other available parameters.
iai::get_prediction_constant.glmnetcv_learner — Function
get_prediction_constant(obj, fit_index = NULL, ...)Return the constant term in the prediction in a trained GLMNet learner
Julia Equivalent: IAI.get_prediction_constant
Arguments
obj: The learner to query.fit_index: The index of the fit in the path to use for prediction, defaulting to the best fit if not supplied....: Additional arguments (unused)
iai::get_prediction_weights.glmnetcv_learner — Function
get_prediction_weights(obj, fit_index = NULL, ...)Return the weights for numeric and categoric features used for prediction in a trained GLMNet learner
Julia Equivalent: IAI.get_prediction_weights
Arguments
obj: The learner to query.fit_index: The index of the fit in the path to use for prediction, defaulting to the best fit if not supplied....: Additional arguments (unused)
iai::get_num_fits.glmnetcv_learner — Function
get_num_fits(obj, ...)Return the number of fits along the path in a trained GLMNet learner
Julia Equivalent: IAI.get_num_fits
Arguments
obj: The GLMNet learner to query....: Additional arguments (unused)