View source: R/predict.multiview.R
predict.multiview | R Documentation |
multiview
fit objectGives fitted values, linear predictors, coefficients and number of non-zero
coefficients from a fitted multiview
object.
## S3 method for class 'multiview'
predict(
object,
newx,
s = NULL,
type = c("link", "response", "coefficients", "class", "nonzero"),
exact = FALSE,
newoffset,
...
)
object |
Fitted "multiview" object. |
newx |
list of new matrices for |
s |
Value(s) of the penalty parameter lambda at which predictions are required. Default is the entire sequence used to create the model. |
type |
Type of prediction required. Type "link" gives the linear predictors (eta scale); Type "response" gives the fitted values (mu scale). Type "coefficients" computes the coefficients at the requested values for s. Type "nonzero" returns a list of the indices of the nonzero coefficients for each value of s. Type "class" returns class labels for binomial family only. |
exact |
This argument is relevant only when predictions are made at values
of |
newoffset |
If an offset is used in the fit, then one must be supplied for making predictions (except for type="coefficients" or type="nonzero"). |
... |
This is the mechanism for passing arguments like |
The object returned depends on type.
# Gaussian
x = matrix(rnorm(100 * 20), 100, 20)
z = matrix(rnorm(100 * 20), 100, 20)
y = rnorm(100)
fit1 = multiview(list(x=x,z=z), y, rho = 0)
predict(fit1, newx = list(x[1:10, ],z[1:10, ]), s = c(0.01, 0.005))
# Binomial
by = sample(c(0,1), 100, replace = TRUE)
fit2 = multiview(list(x=x,z=z), by, family = binomial(), rho=0.5)
predict(fit2, newx = list(x[1:10, ],z[1:10, ]), s = c(0.01, 0.005), type = "response")
# Poisson
py = matrix(rpois(100, exp(y)))
fit3 = multiview(list(x=x,z=z), py, family = poisson(), rho=0.5)
predict(fit3, newx = list(x[1:10, ],z[1:10, ]), s = c(0.01, 0.005), type = "response")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.