Description Usage Arguments Value Examples
Implementation with sparsity of the method which aims at a diagonal reordering.
1 |
g |
number of clusters for rows and columns. |
envrdata |
environment with data. |
zi |
row clusters. |
wj |
column clusters. |
delta |
common constant value per block. |
transfrm |
transformation of the data (0:none, 1:binarization, 2:tf-idf, 3:tf-idf+rows normalization). |
maxiter |
maximum number of iterations. |
debug |
flag for debug, if equal to 1 shows some informations to user. |
The function alters the parameters zi and wj. It returns a vector with the value of the objective function per iterations, and zi, wj which are the estimated cluster labels.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | library(Rcoclust);
#load data
data(data_news4);
envrdata=get_envrdata(A_ijx,lbs,name,1);
#retrieve matrix size and number of classes
n=envrdata$n;
d=envrdata$d;
g=length(unique(envrdata$lbs));
#ddkm
bestresu=NULL;
for (m in 1:100) {
zi_ddkm=as.integer( sample(x = 1:g-1,size = n,replace = TRUE) );
wj_ddkm=as.integer( sample(x = 1:g-1,size = d,replace = TRUE) );
resu=Rcoclust::cc_ddkm(g,envrdata,zi_ddkm,wj_ddkm,-1,3,80,0);
if (m==1) bestresu=resu;
if (m>1) {
if (resu$obj[length(resu$obj)]<bestresu$obj[length(bestresu$obj)])
bestresu=resu;
}
}
print(table(envrdata$lbs,bestresu$zi));
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.