# NOT RUN {
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))
# }
Run the code above in your browser using DataLab