Description Usage Arguments Value Examples
Implementation of the reduction of matrix via a right multiplication with a generated Gaussian random matrix. The data vectors for the columns are not required for the input parameters in envrdata.
1 |
envrdata |
environment with data. |
dimr |
reduced dimension for random projection. |
sgr |
standard deviation for random projection. |
vect_Ar |
vector with the transformed matrix after random projection. |
transfrm |
transformation of the data (0:none, 1:binarization, 2:tf-idf, 3:tf-idf+rows normalization). |
debug |
flag for debug, if equal to 1 shows some informations to user. |
The function alters the matrix in vect_Ar with the result of the reduction.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | library(Rcoclust);
#load data
data(data_cstr);
envrdata=get_envrdata(A_ijx,lbs,name,0);
#retrieve matrix size and number of classes
n=envrdata$n;
d=envrdata$d;
g=length(unique(envrdata$lbs));
#random projection
dimr = min(500,envrdata$d); #reduced dimension
sgr = 1; #std for projection
vect_Ar = rep(0,n*dimr); #reduced matrix in vector form
Rcoclust::randp(envrdata,dimr,sgr,vect_Ar,3,0);
Ar=matrix(vect_Ar,nrow=n,byrow = TRUE);
#kmeans+random projection
km=kmeans(Ar,g);
table(km$cluster,envrdata$lbs);
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.