API Reference
Documentation for the OptImpute
public interface.
Index
IAI.ImputationLearner
IAI.MeanImputationLearner
IAI.OptKNNImputationLearner
IAI.OptSVMImputationLearner
IAI.OptTreeImputationLearner
IAI.RandImputationLearner
IAI.SingleKNNImputationLearner
IAI.ZeroImputationLearner
IAI.fit!
IAI.fit_and_expand!
IAI.impute
IAI.impute_cv
IAI.transform_and_expand
Learners
IAI.ImputationLearner
— TypeImputationLearner(; 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.OptKNNImputationLearner
— TypeLearner for conducting optimal k-NN imputation.
The following parameters are supported (refer to the documentation for each):
For optimal k-NN imputation, you should prefer using fit_transform!
when imputing on the training set, instead of fit!
followed by transform
, as the former makes better use of the training data.
IAI.OptSVMImputationLearner
— TypeLearner for conducting optimal SVM imputation.
The following parameters are supported (refer to the documentation for each):
IAI.OptTreeImputationLearner
— TypeLearner for conducting optimal tree-based imputation.
The following parameters are supported (refer to the documentation for each):
IAI.SingleKNNImputationLearner
— TypeLearner for conducting heuristic k-NN imputation.
The following parameters are supported (refer to the documentation for each):
IAI.MeanImputationLearner
— TypeLearner for conducting mean imputation.
The following parameters are supported (refer to the documentation for each):
IAI.RandImputationLearner
— TypeLearner for conducting random imputation.
The following parameters are supported (refer to the documentation for each):
IAI.ZeroImputationLearner
— TypeLearner for conducting zero imputation.
The following parameters are supported (refer to the documentation for each):
IAI.fit!
— Methodfit!(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!
— Functionfit_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, whereX
is imputed, and missing indicators are added for each feature:affine
for affinely-adaptive expansion, whereX
is imputed, and affine combinations of missing indicators and features are added as correction terms
IAI.transform_and_expand
— Functiontransform_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.impute
— Functionimpute(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.
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.
This function was deprecated in IAI v3.0, and will be removed in a future release.
IAI.impute_cv
— Functionimpute_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.
This function was deprecated in IAI v3.0, and will be removed in a future release.