Learn R Programming

CCAGFA (version 1.0.8)

GFApred: Predict samples of one view given the other(s)

Description

Function for making predictions from some subset of views to the remaining ones. This can be used, for example, for multi-output regression and classification tasks.

Usage

CCApred(pred, Y, model, sample = FALSE, nSample = 100) GFApred(pred, Y, model, sample = FALSE, nSample = 100)

Arguments

pred
A vector of binary indicators telling which of the views are observed (1), and which are to be predicted (0).
Y
The input data as a list of M elements, N times D[m] matrices.
model
A list of model parameters as returned by GFA.
sample
Boolean indicator telling whether to also draw samples from the predictive distribution.
nSample
How many samples to draw if sample=TRUE.

Value

Y
The mean predictions. Also the observed input data is returned, so that Y is in the same format as the input data for GFA.
Z
The mean of the latent variables given the observed data.
covZ
The covariance of the latent variables given the observed data.
sam
List that contain nSample elements. Each is a list that contains the projection matrices (W), the latent variables (Z), and the N samples drawn from the predictive posterior.

Details

Estimates the conditional distribution of Z given the observed view and then estimates the expected predictions for the unobserved view. It is also possible to draw samples from the full predictive distribution, which cannot be specified in analytic form.

See Also

GFA,CCA

Examples

Run this code
  #
  # Assume we have a variable model which has been learned with
  # CCAexperiment() or CCA().
  #
  # Predict the 2nd view:
  #
  # predictedY <- CCApred(c(1,0),Y,model)$Y
  #
  # Draw some samples from the conditional distribution of the
  # first view given the second
  #
  # sampled <- CCApred(c(0,1),Y,model,sample=TRUE,nSample=10)$sam$Y
  #

Run the code above in your browser using DataLab