jolars / sgdnet

Fast Sparse Linear Models for Big Data with SAGA
https://jolars.github.io/sgdnet/
GNU General Public License v3.0
5 stars 2 forks source link

Sparse standardization #18

Closed jolars closed 6 years ago

jolars commented 6 years ago

Sparase in-place standardization (centering)

This pull request adds support for in-place standardization for the sparse implementation.

set.seed(1)
fit_sparse <- sgdnet(heart$x, heart$y, family = "binomial")
set.seed(1)
fit_dense <- sgdnet(as.matrix(heart$x), heart$y, family = "binomial")

library(latticeExtra)
c(sparse = plot(fit_sparse), dense = plot(fit_dense))

image

The implementation of this, however, does not seem as efficient as the one in glmnet and adds quite a bit of overhead whenever the features are already on about the same scale.

Other changes