glmpca-py icon indicating copy to clipboard operation
glmpca-py copied to clipboard

Change array orientation to make indexing more efficient

Open willtownes opened this issue 5 years ago • 0 comments

Currently (due to its R origin) the glmpca method is implemented with frequent indexing along columns of various matrices. This is because R stores data in column-major order so it is faster to retrieve a column than a row. In numpy the data are stored in row-major order so it may be more efficient to transpose everything and index along rows instead. The downside of this would be making it harder to compare the code to the R code. Another possibility would be to force the arrays to use the column-major order with order=F but it's not clear that this will persist throughout all iterations after various transformations and multiplications.

willtownes avatar Oct 13 '19 04:10 willtownes