renozao / NMF

NMF: A Flexible R package for Nonnegative Matrix Factorization
139 stars 41 forks source link

Failed to fix basis. #182

Open TingyanCN opened 6 months ago

TingyanCN commented 6 months ago

I use a toy data to test if I can fix basises, but failed.

W <- matrix(as.numeric(1:35),nrow=7)
H <- matrix(as.numeric(1:45),nrow=5)
V <- W%*%H
W[,4:5] <- 0
init <- nmfModel(W=W,H=H,ibterms=1:3)
nmftest <- nmf(V,5,method='lee',seed=init,maxIter=2)
nmftest@fit@W

but the W return is : [,1] [,2] [,3] [,4] [1,] 0.05046984 0.1391360 0.1575678 0.21418261 [2,] 0.08910186 0.1381895 0.1484001 0.17820633 [3,] 0.12107123 0.1391021 0.1428566 0.15255918 [4,] 0.14892014 0.1411647 0.1395561 0.13335247 [5,] 0.17404334 0.1439883 0.1377400 0.11843191 [6,] 0.19726993 0.1473415 0.1369571 0.10650758 [7,] 0.21912367 0.1510779 0.1369224 0.09675993 [,5] [1,] 0.21418261 [2,] 0.17820633 [3,] 0.15255918 [4,] 0.13335247 [5,] 0.11843191 [6,] 0.10650758 [7,] 0.09675993

the basis is not fixed.How can I deal with it?