Description Usage Arguments Value Author(s) References See Also Examples
Optimizes the DWD objective for a multi-way dataset and a vector of class labels, under the assumption that the coefficient array is of low-rank.
1 |
xmul |
An array of dimensions N x P x M. The initial dimension (N) gives the cases to be classified. |
y |
A vector of length N giving the class label ('-1' or '1') for each case. |
rank |
Assumed rank of the P x M coefficient matrix. |
C |
Penalty parameter for the DWD objective (adjusted by median pairwise distance) |
beta |
P x M matrix of coefficients |
int |
Intercept |
If r=1:
w |
Vector of length P, giving weights in the second dimension |
v |
Vector of length M, giving weights in the third dimension |
Eric F. Lock, Tianmeng Lyu, and Lynn E. Eberly
Hanwen, H., Lu, X., Liu, Y., Haaland, P., & Marron, J. S. (2012). R/DWD: distance-weighted discrimination for classification, visualization and batch adjustment. Bioinformatics, 28(8):1182-3.
1 2 3 4 5 6 | data(IFNB_Data) ##Load gene expression time course data (?IFNB_Data for more info)
results.mw <- mul.dwd(DataArray,y=Class, rank=1) #estimate rank 1 model
names(results.mw)
##Compute projection onto the classification direction for each individual:
DWD_scores <- c()
for(i in 1:length(Class)) DWD_scores[i] = sum(DataArray[i,,]*results.mw$beta)+results.mw$int
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.