observation_impute_cpp | R Documentation |
Get imputed data
observation_impute_cpp(index_xtrain, index_s, xtrain, xtest, S)
index_xtrain |
Positive integer. Represents a sequence of row indices from |
index_s |
Positive integer. Represents a sequence of row indices from |
xtrain |
Numeric matrix. |
xtest |
Numeric matrix. Represents a single test observation. |
S |
Integer matrix of dimension |
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]
.
Numeric matrix
Nikolai Sellereite
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.