# NOT RUN {
library(RDFTensor)
data('umls_tnsr')
ntnsr=umls_tnsr
#Calculate Factorization
tt0=proc.time()
tt=rescal(ntnsr$X,rnk=10,ainit='nvecs',verbose=2,lambdaA=0,epsilon=1e-4,lambdaR=0)
ttq1=proc.time()
A=tt$A
R=tt$R
# reconstruct tensor and calulate
RecRes=RescalReconstructBack(R=R,A=A,otnsr=ntnsr,ncore=3,OS_WIN=TRUE)
print(sprintf('True positive rate:%.2f %%',100*sum(RecRes$TP)/length(RecRes$TP)))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab