impute_cpop | R Documentation |
Imputing gene expression values using CPOP model
impute_cpop(cpop_result, x1, x2, newx)
cpop_result |
cpop_model result |
x1 |
Original feature data matrix 1. |
x2 |
Original feature data matrix 2. |
newx |
New original feature data matrix, with missing values. |
A vector
data(cpop_data_binary, package = 'CPOP') ## Loading simulated matrices and vectors x1 = cpop_data_binary$x1 x2 = cpop_data_binary$x2 x3 = cpop_data_binary$x3 y1 = cpop_data_binary$y1 y2 = cpop_data_binary$y2 y3 = cpop_data_binary$y3 set.seed(1) cpop_result = cpop_model(x1 = x1, x2 = x2, y1 = y1, y2 = y2, alpha = 0.1, n_features = 10) cpop_result x3_pred_result = predict_cpop(cpop_result, newx = x3) head(x3_pred_result) ## Introduce a column of missing values in a new matrix, x4. x4 = x3 x4[,2] = NA ## Without imputation, the prediction function would not work properly ## This prompts the user to use an imputation on their data. ## head(predict_cpop(cpop_result, newx = x4)) ## CPOP can perform imputation on the x4 matrix, before this matrix is converted into z4. x4_imp = impute_cpop(cpop_result, x1 = x1, x2 = x2, newx = x4) x4_pred_result = predict_cpop(cpop_result, newx = x4_imp) head(x4_pred_result) plot(x3_pred_result$cpop_model_avg_prob, x3_pred_result$cpop_model_avg_prob)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.