I am focusing on a relational learning task, where links between entities are predicted across several relations. An example of a relation in this task is if two entities have the same survival outcome after a natural disaster; e.g. if Mary and Bob survived then an edge (or a 1) exists between. These relations are concatenated into a 3 mode tensor and the RESCAL relational learning algorithm is applied for entity link prediction. Refer to: Factorizing YAGO Scalable Machine Learning for Linked Data, Nickel, M. et al for specifics. RESCAL is available in Python with pip install sklearn-tensor.

My Question:

In 1, Section 3.1.1, link prediction for new data is given as X_i_j_k ~= A * R_k * A.T. But it's not explicitly stated which matrices are used to predict entity links in relation k. Given a factorization A, R for training relational data and a new factorization new_A, new_R for new relational data, are new links predicted from new_A * R new_A.T?


from numpy.random import binomial
from scipy.sparse import csr_matrix, coo_matrix
from sktensor.rescal import als as rescal_als

X1 = csr_matrix(binomial(1, 0.25, size=(4,4)))
X2 = csr_matrix(binomial(1, 0.25, size=(4,4)))
X3 = csr_matrix(binomial(1, 0.25, size=(4,4)))
A, R, _, _, _ = rescal_als([X1, X2, X3], 2)

new_X1 = csr_matrix(binomial(1, 0.25, size=(4,4)))
new_X2 = csr_matrix(binomial(1, 0.25, size=(4,4)))
A_new, R_new, _, _, _ = rescal_als([new_X1, new_X2], 2)

# Prediction of Unknown Triples
# see: Section 3.3.1: http://www.dbs.ifi.lmu.de/~tresp/papers/p271.pdf
new_X3 = A_new.dot( R[2] ).dot(A_new.T)
new_X3 > new_X3.mean() # link prediction for some threshold theta?

1 Answer 1


Following up here: An answer here is found within how the RESCAL algorithm is initialized. For the factorization of the new_X* tensor the old latent relational matrix R should be used as the initialization for R_new. This allows the learned local latent relational interactions to drive the factorization of A and vice versa for R_new. Initialized this way the new links are then predicted from new_A * R_new * new_A.T.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.