Leveraging Sparsity to Speed Up Polynomial Feature Expansions of CSR Matrices Using K-Simplex Numbers

03/16/2018
by   Anadrew Nystrom, et al.
0

We provide an algorithm that speeds up polynomial and interaction feature expansion on sparse matrices. The algorithm operates on and produces a compressed sparse row matrix with no densification. It works by defining a bijective function involving simplex numbers of column indices in the original matrix to column indices in the expanded matrix. This function allows for only the nonzero elements to be iterated over and multiplied together, greatly improving the expansion of sparse matrices in compressed sparse row format. For a vector of dimension D and density 0 < d < 1, the algorithm has time complexity Θ(d^KD^K) where K is the polynomial-feature order; this is an improvement by a factor d^K over the standard method.

READ FULL TEXT

Please sign up or login with your details

Forgot password? Click here to reset