igraph / xdata-igraph

xdata igraph, has been merged into igraph/igraph
GNU General Public License v2.0
18 stars 3 forks source link

dot.product.game and adjacency.spectral.embedding matrix representations #35

Closed itmfl closed 10 years ago

itmfl commented 10 years ago

There is a slight inconsistency between the input to dot.product.game and the output of adjacency.spectral.embedding functions.

The input to dot.product.game assume that the columns correspond to the vectors. That is, n latent positions in d dimension, when input to dot.product.game, should be in a form as a dxn matrix.

On the other hand, the output of adjacency.spectral.embedding of a graph on n vertices into d dimension is returned as a nxd matrix.

I think that for consistency, the input to dot.product.game should also be a nxd matrix.

gaborcsardi commented 10 years ago

You mean that you want to rewrite it, or that I should rewrite it?

itmfl commented 10 years ago

At first I was hoping that you will rewrite it as I believe the relevant part of the code that needs to be modified is the C code in the dotproduct.c and I am not too familiar with those. However, looking at the source code for that function it seems like all I need to do is to swap nrow and ncol at several places so I will try to go ahead and change it myself. Thanks.

gaborcsardi commented 10 years ago

I don't really want to change this to be honest, because imo having the vectors in columns is natural, and it is also faster. It is does not match another function, that is unfortunate, but you cannot have everything. The other function's encoding is also natural imo. Just transpose the matrix before feeding it into dot.product.game.

But if you change it, that is fine with me, but please do a better job than last time. In particular:

If you have a question about something in the C code then please ask, and I'll help.