Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

⚠️There's a newer version (1.10.2) of this package.Take me there.

iai: Interpretable AI R Interface

iai is a package providing an interface to the algorithms of Interpretable AI from the R programming language, including:

  • Optimal Trees for classification, regression, prescription and survival analysis
  • Optimal Imputation for missing data imputation and outlier detection
  • Optimal Feature Selection for exact sparse regression

Installation and Usage

Please refer to the official Interpretable AI documentation for information on setting up and using the package.

Copy Link

Version

Install

install.packages('iai')

Monthly Downloads

335

Version

1.1.0

License

MIT + file LICENSE

Maintainer

Jack Dunn

Last Published

September 13th, 2019

Functions in iai (1.1.0)

get_num_samples

Get the number of training points contained in a node of a tree
get_regression_constant

Return the constant term in the regression prediction at a node of a tree
get_grid_results

Return a summary of the results from the grid search
get_learner

Return the fitted learner using the best parameter combination from a grid
get_best_params

Return the best parameter combination from a grid
imputation_learner

Generic learner for imputing missing values
get_parent

Get the index of the parent node at a node of a tree
get_prediction_constant

Return the constant term in the prediction in the trained learner
impute

Impute missing values using either a specified method or through validation
get_classification_label

Return the predicted label at a node of a tree
get_lower_child

Get the index of the lower child at a split node of a tree
get_regression_weights

Return the weights for each feature in the regression prediction at a node of a tree
multi_questionnaire

Construct an interactive questionnaire using multiple tree learners as specified by questions
get_num_nodes

Return the number of nodes in a trained learner
grid_search

Controls grid search over parameter combinations
iai_setup

Initialize Julia and the IAI package.
get_survival_curve_data

Extract the underlying data from a survival curve (as returned by predict or get_survival_curve)
get_rich_output_params

Return the current global rich output parameter settings
get_split_categories

Return the categoric/ordinal information used in the split at a node of a tree
get_upper_child

Get the index of the upper child at a split node of a tree
is_hyperplane_split

Check if a node of a tree applies a hyperplane split
is_ordinal_split

Check if a node of a tree applies a ordinal split
mean_imputation_learner

Learner for conducting mean imputation
apply_nodes

Return the indices of the points in the features that fall into each node of a trained tree model
get_classification_proba

Return the predicted probabilities of class membership at a node of a tree
opt_tree_imputation_learner

Learner for conducting optimal tree-based imputation
multi_tree_plot

Construct an interactive tree visualization of multiple tree learners as specified by questions
optimal_feature_selection_classifier

Learner for conducting Optimal Feature Selection on classification problems
get_split_feature

Return the feature used in the split at a node of a tree
get_params

Return the value of all parameters on a learner
show_questionnaire

Show an interactive questionnaire based on a learner in default browser
single_knn_imputation_learner

Learner for conducting heuristic k-NN imputation
score

Calculate the score for a model on the given data
roc_curve

Construct an ROC curve using a trained model on the given data
get_depth

Get the depth of a node of a tree
is_parallel_split

Check if a node of a tree applies a parallel split
opt_knn_imputation_learner

Learner for conducting optimal k-NN imputation
missing_goes_lower

Check if points with missing values go to the lower child at a split node of of a tree
optimal_feature_selection_regressor

Learner for conducting Optimal Feature Selection on regression problems
get_split_threshold

Return the threshold used in the split at a node of a tree
optimal_tree_classifier

Learner for training Optimal Classification Trees
reset_display_label

Reset the predicted probability displayed to be that of the predicted label when visualizing a learner
read_json

Read in a learner or grid saved in JSON format
is_leaf

Check if a node of a tree is a leaf
set_params

Set all supplied parameters on a learner
opt_svm_imputation_learner

Learner for conducting optimal SVM imputation
predict

Return the predictions made by the model for each point in the features
tree_plot

Specify an interactive tree visualization of a tree learner
set_rich_output_param

Sets a global rich output parameter
variable_importance

Generate a ranking of the variables in the learner according to their importance when training the trees
get_prediction_weights

Return the weights for numeric and categoric features used for prediction in the trained learner
get_split_weights

Return the weights for numeric and categoric features used in the hyperplane split at a node of a tree
predict_outcomes

Return the the predicted outcome for each treatment made by a model for each point in the features
write_questionnaire

Output a learner as an interactive questionnaire in HTML format
split_data

Split the data into training and test datasets
transform

Impute missing values in a dataframe using a fitted imputation model
get_prescription_treatment_rank

Return the treatments ordered from most effective to least effective at a node of a tree
is_categoric_split

Check if a node of a tree applies a categoric split
is_mixed_parallel_split

Check if a node of a tree applies a mixed parallel/categoric split
impute_cv

Impute missing values using cross validation
is_mixed_ordinal_split

Check if a node of a tree applies a mixed ordinal/categoric split
optimal_tree_prescription_maximizer

Learner for training Optimal Prescriptive Trees where the prescriptions should aim to maximize outcomes
optimal_tree_regressor

Learner for training Optimal Regression Trees
get_survival_curve

Return the survival curve at a node of a tree
show_in_browser

Show interactive visualization of an object (such as a learner or curve) in the default browser
predict_proba

Return the probabilities of class membership predicted by a model for each point in the features
print_path

Print the decision path through the learner for each sample in the features
set_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.
optimal_tree_survivor

Learner for training Optimal Survival Trees
write_json

Output a learner or grid in JSON format
write_png

Output a learner as a PNG image
optimal_tree_prescription_minimizer

Learner for training Optimal Prescriptive Trees where the prescriptions should aim to minimize outcomes
questionnaire

Specify an interactive questionnaire of a tree learner
set_julia_seed

Set the random seed in Julia
set_display_label

Show the probability of a specified label when visualizing a learner
rand_imputation_learner

Learner for conducting random imputation
write_html

Output a learner as an interactive browser visualization in HTML format
write_dot

apply

Return the leaf index in a tree model into which each point in the features falls
fit_transform

Fit an imputation model using the given features and impute the missing values in these features
fit_transform_cv

Train a grid using cross-validation with features and impute all missing values in these features
fit

Fits a model to the training data
as.mixeddata

Convert a vector of values to IAI mixed data format
clone

Return an unfitted copy of a learner with the same parameters
fit_cv

Fits a grid search to the training data with cross-validation
decision_path

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.
delete_rich_output_param

Delete a global rich output parameter