API Reference

Documentation for the OptImpute public interface.

Index

Learners

IAI.ImputationLearnerType
ImputationLearner(; method=:opt_knn, keyword_arguments...)

Abstract type containing all imputation learners.

Can be used to construct instances of imputation learners using the method keyword argument.

Additional keyword arguments can be used to specify parameters for the given learner, refer to the documentation for available parameters.

IAI.fit!Method
fit!(lnr::ImputationLearner, X::FeatureInput,
     X_warm::FeatureInput=DataFrame())

Fit lnr with training features X.

X_warm can be used to provide a warmstart, in which case it must be the same as X except for the missing values being filled in. If not provided, the algorithm will automatically generate and choose from multiple warm starts.

Expansion with Adaptive Indicator Features

IAI.fit_and_expand!Function
fit_and_expand!(lnr::ImputationLearner, X::FeatureInput;
                type::Union{Symbol,String})

Fit lnr with training features X and create adaptive indicator features to encode the missing pattern according to type.

The permissible values for type are:

  • :finite for finitely-adaptive expansion, where X is imputed, and missing indicators are added for each feature
  • :affine for affinely-adaptive expansion, where X is imputed, and affine combinations of missing indicators and features are added as correction terms
IAI.transform_and_expandFunction
transform_and_expand(lnr::ImputationLearner, X::FeatureInput;
                     type::Union{Symbol,String})

Transform features X with trained lnr and create adaptive indicator features to encode the missing pattern according to type.

See fit_and_expand! for more information.

Simple Imputation Interface

IAI.imputeFunction
impute(X::FeatureInput, method::Union{Symbol,AbstractString}=:opt_knn;
       X_warm::FeatureInput=DataFrame(), keyword_arguments...)

Impute the missing values in X using the specified imputation method.

A warmstart solution X_warm can optionally be supplied, which must be the same data as X with the missing values filled in. If not supplied, the algorithm will automatically generate and choose between multiple warm starts.

Additional keyword arguments can be used to specify parameters for the given method, refer to the documentation for available parameters.

Warning

This function was deprecated in IAI v3.0, and will be removed in a future release.

impute(X::FeatureInput, params::Dict; train_proportion::Number=0.7,
       keyword arguments...)

Impute the missing values in X, validating over params using a grid search.

params should be a Dict specifying the learner parameters and corresponding ranges to be validated over.

train_proportion can be specified to control the proportion of data that is used for training.

Additional keyword arguments can be used to specify learner parameters that should be used for all parameter combinations in the grid, refer to the documentation for available parameters.

Warning

This function was deprecated in IAI v3.0, and will be removed in a future release.

IAI.impute_cvFunction
impute_cv(X::FeatureInput, params::Dict; n_folds::Int=5,
          keyword arguments...)

Like impute(X, params) but uses cross-validation to select the best parameter combination.

n_folds can be specified to control the number of folds used in the cross-validation.

Warning

This function was deprecated in IAI v3.0, and will be removed in a future release.