API Reference
Documentation for the iai
package
Index
iai::all_treatment_combinations
iai::apply
iai::apply_nodes
iai::as.mixeddata
iai::categorical_reward_estimator
iai::clone
iai::convert_treatments_to_numeric
iai::decision_path
iai::delete_rich_output_param
iai::equal_propensity_estimator
iai::fit
iai::fit_cv
iai::fit_predict
iai::fit_transform
iai::fit_transform_cv
iai::get_best_params
iai::get_classification_label
iai::get_classification_proba
iai::get_depth
iai::get_grid_results
iai::get_learner
iai::get_lower_child
iai::get_num_fits
iai::get_num_nodes
iai::get_num_samples
iai::get_params
iai::get_parent
iai::get_policy_treatment_outcome
iai::get_policy_treatment_rank
iai::get_prediction_constant
iai::get_prediction_weights
iai::get_prescription_treatment_rank
iai::get_regression_constant
iai::get_regression_weights
iai::get_rich_output_params
iai::get_roc_curve_data
iai::get_split_categories
iai::get_split_feature
iai::get_split_threshold
iai::get_split_weights
iai::get_survival_curve
iai::get_survival_curve_data
iai::get_survival_expected_time
iai::get_survival_hazard
iai::get_upper_child
iai::glmnetcv_regressor
iai::grid_search
iai::iai_setup
iai::imputation_learner
iai::impute
iai::impute_cv
iai::is_categoric_split
iai::is_hyperplane_split
iai::is_leaf
iai::is_mixed_ordinal_split
iai::is_mixed_parallel_split
iai::is_ordinal_split
iai::is_parallel_split
iai::mean_imputation_learner
iai::missing_goes_lower
iai::multi_questionnaire
iai::multi_questionnaire.default
iai::multi_questionnaire.grid_search
iai::multi_tree_plot
iai::multi_tree_plot.default
iai::multi_tree_plot.grid_search
iai::numeric_reward_estimator
iai::opt_knn_imputation_learner
iai::opt_svm_imputation_learner
iai::opt_tree_imputation_learner
iai::optimal_feature_selection_classifier
iai::optimal_feature_selection_regressor
iai::optimal_tree_classifier
iai::optimal_tree_policy_maximizer
iai::optimal_tree_policy_minimizer
iai::optimal_tree_prescription_maximizer
iai::optimal_tree_prescription_minimizer
iai::optimal_tree_regressor
iai::optimal_tree_survival_learner
iai::predict
iai::predict_expected_survival_time
iai::predict_hazard
iai::predict_outcomes
iai::predict_proba
iai::predict_treatment_outcome
iai::predict_treatment_rank
iai::print_path
iai::questionnaire
iai::rand_imputation_learner
iai::random_forest_classifier
iai::random_forest_regressor
iai::read_json
iai::reset_display_label
iai::roc_curve
iai::roc_curve.default
iai::roc_curve.learner
iai::score
iai::set_display_label
iai::set_julia_seed
iai::set_params
iai::set_rich_output_param
iai::set_threshold
iai::show_in_browser
iai::show_questionnaire
iai::single_knn_imputation_learner
iai::split_data
iai::transform
iai::tree_plot
iai::variable_importance
iai::write_booster
iai::write_dot
iai::write_html
iai::write_json
iai::write_pdf
iai::write_png
iai::write_questionnaire
iai::write_svg
iai::xgboost_classifier
iai::xgboost_regressor
General Utilities
iai::iai_setup
— Functioniai_setup(...)
Initialize Julia and the IAI package.
This needs to be done in every R session before calling iai
functions
Arguments
...
: All parameters are passed through toJuliaCall::julia_setup
iai::set_julia_seed
— Functionset_julia_seed(seed)
Set the random seed in Julia
Julia Equivalent: Random.seed!
Arguments
seed
: The seed to set
iai::get_rich_output_params
— Functionget_rich_output_params()
Return the current global rich output parameter settings
Julia Equivalent: IAI.get_rich_output_params
iai::set_rich_output_param
— Functionset_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
— Functiondelete_rich_output_param(key)
Delete a global rich output parameter
Julia Equivalent: IAI.delete_rich_output_param!
Arguments
key
: The parameter to delete.
iai::show_in_browser
— Functionshow_in_browser(obj, ...)
Show interactive visualization of an object (such as a learner or curve) in the default browser
Julia Equivalent: IAI.show_in_browser
Arguments
obj
: The object to visualize....
: Refer to the Julia documentation for available parameters.
Showing a grid search requires IAI version 2.0 or higher.
Data Preparation
iai::as.mixeddata
— Functionas.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 invalues
to treat as categoric levelsordinal_levels
: (optional) The values invalues
to treat as ordinal levels, in the order supplied
iai::split_data
— Functionsplit_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.
Learners
General learners
iai::fit
— Functionfit(lnr, X, ...)
Fits a model to the training data
Julia Equivalent: IAI.fit!
Arguments
lnr
: 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::set_params
— Functionset_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
— Functionget_params(lnr)
Return the value of all parameters on a learner
Julia Equivalent: IAI.get_params
Arguments
lnr
: The learner to query.
iai::clone
— Functionclone(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
— Functionread_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
— Functionwrite_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
— Functionpredict(lnr, X, ...)
Return the predictions made by the model for each point in the features
Julia Equivalent: IAI.predict
Arguments
lnr
: The learner or grid to use for prediction.X
: The features of the data....
: Refer to the Julia documentation for available parameters.
iai::score
— Functionscore(lnr, X, ...)
Calculate the score for a model on the given data
Julia Equivalent: IAI.score
Arguments
lnr
: 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::variable_importance
— Functionvariable_importance(lnr)
Generate a ranking of the variables in the learner according to their importance during training. The results are normalized so that they sum to one.
Julia Equivalent: IAI.variable_importance
Arguments
lnr
: The learner to query.
Classification learners
iai::predict_proba
— Functionpredict_proba(lnr, X)
Return the probabilities of class membership predicted by a model for each point in the features
Julia Equivalent: IAI.predict_proba
Arguments
lnr
: The learner or grid to use for prediction.X
: The features of the data.
iai::roc_curve
— Functionroc_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.learner
— Functionroc_curve(obj, X, y, ...)
Construct an ROC curve using a trained model 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....
: Additional arguments (unused)
iai::roc_curve.default
— Functionroc_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)
Requires IAI version 2.0 or higher.
iai::get_roc_curve_data
— Functionget_roc_curve_data(curve)
Extract the underlying data from an ROC curve (as returned by roc_curve
)
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.
Requires IAI version 2.1 or higher.
Survival learners
iai::predict_hazard
— Functionpredict_hazard(lnr, X)
Return the fitted hazard coefficient estimate made by a model for each point in the features.
A higher hazard coefficient estimate corresponds to a smaller predicted survival time.
Julia Equivalent: IAI.predict_hazard
Arguments
lnr
: The learner or grid to use for prediction.X
: The features of the data.
Requires IAI version 1.2 or higher.
iai::predict_expected_survival_time
— Functionpredict_expected_survival_time(lnr, X)
Return the expected survival time estimate made by a model for each point in the features.
Julia Equivalent: IAI.predict_expected_survival_time
Arguments
lnr
: The learner or grid to use for prediction.X
: The features of the data.
Requires IAI version 2.0 or higher.
iai::get_survival_curve_data
— Functionget_survival_curve_data(curve)
Extract the underlying data from a survival curve (as returned by predict
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.
Prescription and policy learners
iai::predict_outcomes
— Functionpredict_outcomes(lnr, X, ...)
Return the predicted outcome for each treatment made by a model for each point in the features
Julia Equivalent: IAI.predict_outcomes
(for prescription or policy learners as appropriate)
Arguments
lnr
: The learner or grid to use for prediction.X
: The features of the data....
: For policy learners only, the reward matrix.
Requires IAI version 2.0 or higher for policy learners.
Policy learners
iai::predict_treatment_rank
— Functionpredict_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.
Requires IAI version 2.1 or higher.
iai::predict_treatment_outcome
— Functionpredict_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.
Requires IAI version 2.1 or higher.
Imputation learners
iai::transform
— Functiontransform(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.
iai::fit_transform
— Functionfit_transform(lnr, X, ...)
Fit an imputation model using the given features and impute the missing values in these features
Similar to calling fit
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.
Grid Search
iai::grid_search
— Functiongrid_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_cv
— Functionfit_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
— Functionfit_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
— Functionget_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
— Functionget_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_results
— Functionget_grid_results(grid)
Return a summary of the results from the grid search
Julia Equivalent: IAI.get_grid_results
Arguments
grid
: The grid search to query.
Tree Learners
General tree learners
iai::apply
— Functionapply(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
— Functionapply_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
— Functiondecision_path(lnr, X)
Return a matrix where entry (i, j)
is true if the i
th point in the features passes through the j
th 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
— Functionprint_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::get_num_nodes
— Functionget_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
— Functionget_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
— Functionget_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
— Functionget_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
— Functionget_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
— Functionget_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
— Functionis_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
— Functionis_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
— Functionis_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
— Functionis_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
— Functionis_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
— Functionis_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
— Functionis_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
— Functionget_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
— Functionget_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
— Functionget_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
— Functionget_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
— Functionmissing_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
— Functionget_classification_label(lnr, node_index, ...)
Return the predicted label at a node of a tree
Julia Equivalent: IAI.get_classification_label
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_classification_proba
— Functionget_classification_proba(lnr, node_index, ...)
Return the predicted probabilities of class membership at a node of a tree
Julia Equivalent: IAI.get_classification_proba
Arguments
lnr
: The learner to query.node_index
: The node in the tree to query....
: Refer to the Julia documentation for available parameters.
iai::set_threshold
— Functionset_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 whichlabel
will be be predicted....
: Refer to the Julia documentation for available parameters.
iai::set_display_label
— Functionset_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
— Functionreset_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
— Functionget_regression_constant(lnr, node_index, ...)
Return the constant term in the regression prediction at a node of a tree
Julia Equivalent: IAI.get_regression_constant
(for regression or prescription tree learners as appropriate)
Arguments
lnr
: The learner to query.node_index
: The node in the tree to query....
: If a prescription problem, the treatment to query.
iai::get_regression_weights
— Functionget_regression_weights(lnr, node_index, ...)
Return the weights for each feature in the regression prediction at a node of a tree
Julia Equivalent: IAI.get_regression_weights
(for regression or prescription tree learners as appropriate)
Arguments
lnr
: The learner to query.node_index
: The node in the tree to query....
: If a prescription problem, the treatment to query.
Survival tree learners
iai::get_survival_curve
— Functionget_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
— Functionget_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.
Requires IAI version 2.1 or higher.
iai::get_survival_hazard
— Functionget_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.
Requires IAI version 2.1 or higher.
Prescription tree learners
iai::get_prescription_treatment_rank
— Functionget_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.
Prescription tree learners also support:
Policy tree learners
iai::get_policy_treatment_rank
— Functionget_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.
Requires IAI version 2.0 or higher.
iai::get_policy_treatment_outcome
— Functionget_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.
Requires IAI version 2.1 or higher.
Tree learner visualization
iai::write_png
— Functionwrite_png(filename, lnr, ...)
Output a learner as a PNG image
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
— Functionwrite_pdf(filename, lnr, ...)
Output a learner as a PDF image
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.
Requires IAI version 2.1 or higher.
iai::write_svg
— Functionwrite_svg(filename, lnr, ...)
Output a learner as a SVG image
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.
Requires IAI version 2.1 or higher.
iai::write_dot
— Functionwrite_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::write_html
— Functionwrite_html(filename, lnr, ...)
Output a learner as an interactive browser visualization in HTML format
Julia Equivalent: IAI.write_html
Arguments
filename
: Where to save the output.lnr
: The learner or grid to output....
: Refer to the Julia documentation for available parameters.
Outputting a grid search requires IAI version 2.0 or higher.
iai::write_questionnaire
— Functionwrite_questionnaire(filename, lnr, ...)
Output a learner as an interactive questionnaire in HTML format
Julia Equivalent: IAI.write_questionnaire
Arguments
filename
: Where to save the output.lnr
: The learner or grid to output....
: Refer to the Julia documentation for available parameters.
Outputting a grid search requires IAI version 2.0 or higher.
iai::show_questionnaire
— Functionshow_questionnaire(lnr, ...)
Show an interactive questionnaire based on a learner in default browser
Julia Equivalent: IAI.show_questionnaire
Arguments
lnr
: The learner or grid to visualize....
: Refer to the Julia documentation for available parameters.
Showing a grid search requires IAI version 2.0 or higher.
iai::tree_plot
— Functiontree_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.
Requires IAI version 1.1 or higher.
iai::questionnaire
— Functionquestionnaire(lnr, ...)
Specify an interactive questionnaire of a tree learner
Julia Equivalent: IAI.Questionnaire
Arguments
lnr
: The learner to visualize....
: Refer to the Julia documentation for available parameters.
Requires IAI version 1.1 or higher.
iai::multi_tree_plot
— Functionmulti_tree_plot(obj, ...)
Generic function for constructing an interactive tree visualization of multiple tree learners
Julia Equivalent: IAI.MultiTreePlot
Arguments
obj
: The object controlling which method is used...
: Arguments depending on the specific method used
iai::multi_tree_plot.default
— Functionmulti_tree_plot(obj, ...)
Construct an interactive tree visualization of multiple tree learners as specified by questions
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)
Requires IAI version 1.1 or higher.
iai::multi_tree_plot.grid_search
— Functionmulti_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)
Requires IAI version 2.0 or higher.
iai::multi_questionnaire
— Functionmulti_questionnaire(obj, ...)
Generic function for constructing an interactive questionnaire using multiple tree learners
Julia Equivalent: IAI.MultiQuestionnaire
Arguments
obj
: The object controlling which method is used...
: Arguments depending on the specific method used
iai::multi_questionnaire.default
— Functionmulti_questionnaire(obj, ...)
Construct an interactive questionnaire using multiple tree learners as specified by questions
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)
Requires IAI version 1.1 or higher.
iai::multi_questionnaire.grid_search
— Functionmulti_questionnaire(obj, ...)
Construct an interactive tree questionnaire using multiple tree learners from the results of a grid search
Julia Equivalent: IAI.MultiQuestionnaire
Arguments
obj
: The grid to visualize...
: Additional arguments (unused)
Requires IAI version 2.0 or higher.
Optimal Trees
iai::optimal_tree_classifier
— Functionoptimal_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
— Functionoptimal_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
— Functionoptimal_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
— Functionoptimal_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
— Functionoptimal_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
— Functionoptimal_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.
Requires IAI version 2.0 or higher.
iai::optimal_tree_policy_maximizer
— Functionoptimal_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.
Requires IAI version 2.0 or higher.
OptImpute
iai::impute
— Functionimpute(X, ...)
Impute missing values using either a specified method or through validation
Julia Equivalent: IAI.impute
Arguments
X
: The dataframe in which to impute missing values....
: Refer to the Julia documentation for available parameters.
iai::impute_cv
— Functionimpute_cv(X, ...)
Impute missing values using cross validation
Julia Equivalent: IAI.impute_cv
Arguments
X
: The dataframe in which to impute missing values....
: Refer to the Julia documentation for available parameters.
iai::imputation_learner
— Functionimputation_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
— Functionopt_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
— Functionopt_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
— Functionopt_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
— Functionsingle_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
— Functionmean_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
— Functionrand_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.
Optimal Feature Selection
iai::optimal_feature_selection_classifier
— Functionoptimal_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.
Requires IAI version 1.1 or higher.
iai::optimal_feature_selection_regressor
— Functionoptimal_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.
Requires IAI version 1.1 or higher.
iai::get_prediction_constant
— Functionget_prediction_constant(lnr, ...)
Return the constant term in the prediction in the trained learner
Julia Equivalent: IAI.get_prediction_constant
Arguments
lnr
: The learner to query....
: If a GLMNet learner, the index of the fit in the path to query, defaulting to the best fit if not supplied.
Requires IAI version 1.1 or higher.
iai::get_prediction_weights
— Functionget_prediction_weights(lnr, ...)
Return the weights for numeric and categoric features used for prediction in the trained learner
Julia Equivalent: IAI.get_prediction_weights
Arguments
lnr
: The learner to query....
: If a GLMNet learner, the index of the fit in the path to query, defaulting to the best fit if not supplied.
Requires IAI version 1.1 or higher.
Reward Estimation
iai::fit_predict
— Functionfit_predict(lnr, X, treatments, outcomes, ...)
Fit a reward estimation model on features, treatments and outcomes and return predicted counterfactual rewards for each observation, as well as the score of the internal outcome estimator.
For categorical treatments, returns the estimated reward under each treatment observed in the data. For numeric treatments, returns the estimated reward under each treatment candidate.
Julia Equivalent: IAI.fit_predict!
Arguments
lnr
: The learner or grid to use for estimationX
: The features of the data.treatments
: The treatment applied to each point in the data.outcomes
: The outcome observed for each point in the data....
: For numeric treatments, the treatment candidates to consider
Categorical Treatments
iai::categorical_reward_estimator
— Functioncategorical_reward_estimator(...)
Learner for conducting reward estimation with categorical treatments
Julia Equivalent: IAI.CategoricalRewardEstimator
Arguments
...
: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
Requires IAI version 2.0 or higher.
iai::equal_propensity_estimator
— Functionequal_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.
Requires IAI version 2.1 or higher.
Numeric Treatments
iai::numeric_reward_estimator
— Functionnumeric_reward_estimator(...)
Learner for conducting reward estimation with numeric treatments
Julia Equivalent: IAI.NumericRewardEstimator
Arguments
...
: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
Requires IAI version 2.1 or higher.
iai::all_treatment_combinations
— Functionall_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
— Functionconvert_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
— Functionrandom_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.
Requires IAI version 2.1 or higher.
iai::random_forest_regressor
— Functionrandom_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.
Requires IAI version 2.1 or higher.
XGBoost
iai::xgboost_classifier
— Functionxgboost_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.
Requires IAI version 2.1 or higher.
iai::xgboost_regressor
— Functionxgboost_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.
Requires IAI version 2.1 or higher.
iai::write_booster
— Functionwrite_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.
Requires IAI version 2.1 or higher.
GLMNet
iai::glmnetcv_regressor
— Functionglmnetcv_regressor(...)
Learner for training GLMNet models for regression problems
Julia Equivalent: IAI.GLMNetCVRegressor
Arguments
...
: Use keyword arguments to set parameters on the resulting learner. Refer to the Julia documentation for available parameters.
Requires IAI version 2.1 or higher.
iai::get_num_fits
— Functionget_num_fits(lnr)
Return the number of fits along the path in the trained learner
Julia Equivalent: IAI.get_num_fits
Arguments
lnr
: The GLMNet learner to query.
Requires IAI version 2.1 or higher.