multiview  R Documentation 
multiview
uses glmnet::glmnet()
to do most of its work and
therefore takes many of the same parameters, but an intercept is
always included and several other parameters do not
apply. Such inapplicable arguments are overridden and warnings issued.
multiview(
x_list,
y,
rho = 0,
family = gaussian(),
weights = NULL,
offset = NULL,
alpha = 1,
nlambda = 100,
lambda.min.ratio = ifelse(nobs < nvars, 0.01, 1e04),
lambda = NULL,
standardize = TRUE,
intercept = TRUE,
thresh = 1e07,
maxit = 1e+05,
penalty.factor = rep(1, nvars),
exclude = list(),
lower.limits = Inf,
upper.limits = Inf,
trace.it = 0
)
x_list 
a list of 
y 
the quantitative response with length equal to 
rho 
the weight on the agreement penalty, default 0. 
family 
A description of the error distribution and link function to be used in the model. This is the result of a call to a family function. Default is stats::gaussian. (See stats::family for details on family functions.) 
weights 
observation weights. Can be total counts if responses are proportion matrices. Default is 1 for each observation 
offset 
A vector of length 
alpha 
The elasticnet mixing parameter, with

nlambda 
The number of 
lambda.min.ratio 
Smallest value for 
lambda 
A user supplied 
standardize 
Logical flag for x variable standardization,
prior to fitting the model sequence. The coefficients are always
returned on the original scale. Default is

intercept 
Should intercept(s) be fitted (default 
thresh 
Convergence threshold for coordinate descent. Each
inner coordinatedescent loop continues until the maximum change
in the objective after any coefficient update is less than

maxit 
Maximum number of passes over the data for all lambda values; default is 10^5. 
penalty.factor 
Separate penalty factors can be applied to
each coefficient. This is a number that multiplies 
exclude 
Indices of variables to be excluded from the
model. Default is none. Equivalent to an infinite penalty factor
for the variables excluded (next item). Users can supply instead
an 
lower.limits 
Vector of lower limits for each coefficient;
default 
upper.limits 
Vector of upper limits for each coefficient;
default 
trace.it 
If 
The current code can be slow for "large" data sets, e.g. when the number of features is larger than 1000. It can be helpful to see the progress of multiview as it runs; to do this, set trace.it = 1 in the call to multiview or cv.multiview. With this, multiview prints out its progress along the way. One can also prefilter the features to a smaller set, using the exclude option, with a filter function.
If there are missing values in the feature matrices: we recommend that you center the columns of each feature matrix, and then fill in the missing values with 0.
For example,
x < scale(x,TRUE,FALSE)
x[is.na(x)] < 0
z < scale(z,TRUE,FALSE)
z[is.na(z)] < 0
Then run multiview in the usual way. It will exploit the assumed shared latent factors to make efficient use of the available data.
An object with S3 class "multiview","*"
, where "*"
is
"elnet"
, "lognet"
, "multnet"
, "fishnet"
(poisson),
"coxnet"
or "mrelnet"
for the various types of models.
call 
the call that produced this object 
a0 
Intercept sequence of length 
beta 
For 
lambda 
The actual sequence of 
lambda 
The sequence of lambda values 
mvlambda 
The corresponding sequence of multiview lambda values 
dev.ratio 
The fraction of (null) deviance explained (for

nulldev 
Null deviance (per observation). This is defined to be 2*(loglike_sat loglike(Null)); The NULL model refers to the intercept model, except for the Cox, where it is the 0 model. 
df 
The number of nonzero coefficients for each
value of 
dfmat 
For 
dim 
dimension of coefficient matrix (ices) 
nobs 
number of observations 
npasses 
total passes over the data summed over all lambda values 
offset 
a logical variable indicating whether an offset was included in the model 
jerr 
error flag, for warnings and errors (largely for internal debugging). 
print
, coef
, coef_ordered
, predict
, and plot
methods for "multiview"
, and the "cv.multiview"
function.
# Gaussian
x = matrix(rnorm(100 * 20), 100, 20)
z = matrix(rnorm(100 * 10), 100, 10)
y = rnorm(100)
fit1 = multiview(list(x=x,z=z), y, rho = 0)
print(fit1)
# extract coefficients at a single value of lambda
coef(fit1, s = 0.01)
# extract ordered (standardized) coefficients at a single value of lambda
coef_ordered(fit1, s = 0.01)
# make predictions
predict(fit1, newx = list(x[1:10, ],z[1:10, ]), s = c(0.01, 0.005))
# make a path plot of features for the fit
plot(fit1, label=TRUE)
# 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")
coef_ordered(fit2, s = 0.01)
plot(fit2, label=TRUE)
# 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")
coef_ordered(fit3, s = 0.01)
plot(fit3, label=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.