Description Usage Arguments Value Author(s) References See Also Examples
implements topFiberM Boolean matrix factorization algorithm. topFiberM chooses in a greedy way the fibers (rows or columns) to represent the entire matrix. Fibers are extended to rectangles according to a threshold on precision. The search for these" top fibers" can continue beyond the required rank and according to an optional parameter that defines the limit for this search.
1 |
X |
the input boolean sparse matrix |
r |
rank (number of factors) required. |
tP |
parameter to put threshold on precision |
verbose |
integer value to control the appearance of messages. 0 minimal messages will be showed. Default 2 |
SR |
search limit which defines the number iterations, minimum value is rank and maximum value is minimum number of columns and number of rows |
List of the following four components:
A |
Factor matrix A |
B |
Factor matrix B |
X1 |
remaining uncovered ones, (False negatives) |
tf |
dataframe logging of steps giving description of each factor, contains index, based on column (2) / row (1), nnz, TP, FP |
Abdelmoneim Amer Desouki
Desouki, A. A., Roeder, M., & Ngomo, A. C. N. (2019). topFiberM: Scalable and Efficient Boolean Matrix Factorization. arXiv preprint arXiv:1903.10326.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | data(DBLP)
r=7
tP=0.6
X=DBLP
Xb=X==1#Convert to boolean
Res=topFiberM(Xb,r=r,tP=tP,SR=100,verbose=1)
X_=Res$A %*% Res$B
X_=as(X_,'TsparseMatrix')
#Calculate metrics
tempX=as(X,'TsparseMatrix')
li=tempX@i[tempX@x==1]+1
lj=tempX@j[tempX@x==1]+1
tp=sum(X_[cbind(li,lj)]>0)
fn=sum(X)-tp#sum(!X_[cbind(li,lj)])
fp=sum(X_@x>0)-tp
cv=1-(fp+fn)/(tp+fn)
print(sprintf("tp:%d, fp:%d,fn:%d, Error:%d, covered=%.3f",tp,fp,fn,fn+fp,cv))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.