Learn R Programming

sparselink (version 1.0.0)

fuse_data: Data fusion

Description

Data fusion

Usage

fuse_data(x, y = NULL, foldid = NULL)

Value

Returns a list with the concatenated feature matrices in slot x (\((\sum_i^q n_i) \times p\) matrix), the concatenated target vectors in slot y (vector of length \((\sum_i^q n_i)\)), and the indices of the problems in slot index (vector of length \((\sum_i^q n_i)\) with entries \(1,\ldots,q\)).

Arguments

x

list of \(q\) matrices, with \(n_1,\ldots,n_q\) rows and with \(p\) columns

y

list of \(q\) vectors, of length \(n_1,\ldots,n_q\), or NULL (default)

foldid

list of \(q\) vectors, of length \(n_1,\ldots,n_q\), or NULL (default)

Examples

Run this code
data <- sim_data_trans()
sapply(X=data$y_train,FUN=length)
sapply(X=data$X_train,FUN=dim)
fuse <- fuse_data(x=data$X_train,y=data$y_train)
length(fuse$y)
dim(fuse$x)
table(fuse$index)

Run the code above in your browser using DataLab