Get imputed data
observation_impute_cpp(index_xtrain, index_s, xtrain, xtest, S)
Positive integer. Represents a sequence of row indices from xtrain
,
i.e. min(index_xtrain) >= 1
and max(index_xtrain) <= nrow(xtrain)
.
Positive integer. Represents a sequence of row indices from S
,
i.e. min(index_s) >= 1
and max(index_s) <= nrow(S)
.
Numeric matrix.
Numeric matrix. Represents a single test observation.
Integer matrix of dimension n_combinations x m
, where n_combinations
equals
the total number of sampled/non-sampled feature combinations and m
equals
the total number of unique features. Note that m = ncol(xtrain)
. See details
for more information.
Numeric matrix
S(i, j) = 1
if and only if feature j
is present in feature
combination i
, otherwise S(i, j) = 0
. I.e. if m = 3
, there
are 2^3 = 8
unique ways to combine the features. In this case dim(S) = c(8, 3)
.
Let's call the features x1, x2, x3
and take a closer look at the combination
represented by s = c(x1, x2)
. If this combination is represented by the second row,
the following is true: S[2, 1:3] = c(1, 1, 0)
.
The returned object, X
, is a numeric matrix where
dim(X) = c(length(index_xtrain), ncol(xtrain))
. If feature j
is present in
the k-th observation, that is S[index_[k], j] == 1
, X[k, j] = xtest[1, j]
.
Otherwise X[k, j] = xtrain[index_xtrain[k], j]
.