Description Usage Arguments Value Author(s) See Also Examples
convert tensor frontal slices to indices with three columns (i.e i ,j , k)
1 | getTnsrijk(X)
|
X |
LIST of sparce matrices, with each entry representing one predicate. |
a matrix of three columns representing indices of 1 values in the tensor
Abdelmoneim Amer Desouki
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | trp=rbind(
cbind('Alex', 'loves', 'Don'),
cbind('Alex', 'loves', 'Elly'),
cbind('Alex', 'hates', 'Bob'),
cbind('Don', 'loves', 'Alex'),
cbind('Don', 'hates', 'Chris'),
cbind('Chris', 'hates', 'Bob'),
cbind('Bob', 'hates', 'Chris'),
cbind('Elly', 'hates', 'Chris'),
cbind('Elly', 'hates', 'Bob'),
cbind('Elly', 'loves', 'Alex')
)
######
# form tensor as a set of frontal slices (Predicate mode)
tnsr=getTensor(trp)
subs=getTnsrijk(tnsr$X)
print(subs)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.