From d05a4c04f9106d26cb465c307263d0acf48e9828 Mon Sep 17 00:00:00 2001 From: tabpeter <85952288+tabpeter@users.noreply.github.com> Date: Fri, 19 Apr 2024 13:30:51 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20pbreheny?= =?UTF-8?q?/biglasso@3bbfbaab94c0042f61df67fee5e78ee934a29af6=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 2 +- articles/biglasso.html | 10 +- articles/index.html | 2 +- authors.html | 2 +- index.html | 22 +-- news/index.html | 2 +- pkgdown.yml | 4 +- reference/biglasso-package.html | 2 +- reference/biglasso.html | 2 +- reference/biglasso_fit.html | 4 +- reference/biglasso_path.html | 276 +++++++++++++++++++++++++++++ reference/colon.html | 2 +- reference/cv.biglasso.html | 2 +- reference/index.html | 4 +- reference/loss.biglasso.html | 2 +- reference/plot.biglasso.html | 2 +- reference/plot.cv.biglasso.html | 2 +- reference/plot.mbiglasso.html | 2 +- reference/predict.biglasso.html | 2 +- reference/predict.cv.biglasso.html | 2 +- reference/setupX.html | 2 +- reference/summary.cv.biglasso.html | 2 +- sitemap.xml | 2 +- 23 files changed, 315 insertions(+), 39 deletions(-) create mode 100644 reference/biglasso_path.html diff --git a/404.html b/404.html index bff9e54..867848e 100644 --- a/404.html +++ b/404.html @@ -91,7 +91,7 @@
system.time({fit <- biglasso(X.bm, y)})
#> user system elapsed
-#> 0.177 0.001 0.177
+#> 0.192 0.004 0.197
plot(fit)
Site built with pkgdown 2.0.8.
+Site built with pkgdown 2.0.9.
diff --git a/articles/index.html b/articles/index.html index 8f676e9..179b651 100644 --- a/articles/index.html +++ b/articles/index.html @@ -65,7 +65,7 @@biglasso
extends lasso and elastic-net linear and logistic regression models for ultrahigh-dimensional, multi-gigabyte data sets that cannot be loaded into memory. It utilizes memory-mapped files to store the massive data on the disk and only read those into memory whenever necessary during model fitting. Moreover, some advanced feature screening rules are proposed and implemented to accelerate the model fitting. As a result, this package is much more memory- and computation-efficient and highly scalable as compared to existing lasso-fitting packages such as glmnet and ncvreg. Bechmarking experiments using both simulated and real data sets show that biglasso
is not only 1.5x to 4x times faster than existing packages, but also at least 2x more memory-efficient. More importantly, to the best of our knowledge, biglasso
is the first R package that enables users to fit lasso models with data sets that are larger than available RAM, thus allowing for powerful big data analysis on an ordinary laptop.
To install the latest stable release version from CRAN:
+
+install.packages("biglasso")
To install the latest development version from GitHub:
+
+remotes::install_github("YaohuiZeng/biglasso")
To install the latest stable release version from CRAN:
-
-install.packages("biglasso")
To install the latest development version from GitHub:
-
-remotes::install_github("YaohuiZeng/biglasso")
R/biglasso_path.R
+ biglasso_path.Rd
NOTE: this function is designed for users who have a strong understanding of +statistics and know exactly what they are doing. This is a simplification of +the main `biglasso()` function with more flexible settings.
+The design matrix, without an intercept. It must be a
+double type big.matrix
object.
The response vector
Residuals (length n vector) corresponding to `init`. +WARNING: If you supply an incorrect value of `r`, the +solution will be incorrect.
Initial values for beta. Default: zero (length p vector)
X scales: the jth element should equal `crossprod(X[,j])/n`. +In particular, if X is standardized, one should pass +`xtx = rep(1, p)`. WARNING: If you supply an incorrect value of +`xtx`, the solution will be incorrect. (length p vector)
String specifying which penalty to use. Default is 'lasso', +Other options are 'SCAD' and 'MCP' (the latter are non-convex)
A vector of numeric values the lasso tuning parameter.
The elastic-net mixing parameter that controls the relative
+contribution from the lasso (l1) and the ridge (l2) penalty.
+The penalty is defined as:
+$$ \alpha||\beta||_1 + (1-\alpha)/2||\beta||_2^2.$$
+alpha=1
is the lasso penalty, alpha=0
the ridge penalty,
+alpha
in between 0 and 1 is the elastic-net ("enet") penalty.
Tuning parameter value for nonconvex penalty. Defaults are +3.7 for `penalty = 'SCAD'` and 3 for `penalty = 'MCP'`
The number of OpenMP threads used for parallel computing.
Maximum number of iterations. Default is 1000.
Convergence threshold for inner coordinate descent. The
+algorithm iterates until the maximum change in the objective
+after any coefficient update is less than eps
times
+the null deviance. Default value is 1e-7
.
Upper bound for the number of nonzero coefficients. Default is +no upper bound. However, for large data sets, +computational burden may be heavy for models with a large +number of nonzero coefficients.
A multiplicative factor for the penalty applied to
+each coefficient. If supplied, penalty.factor
must be a numeric
+vector of length equal to the number of columns of X
.
Return warning messages for failures to converge and model +saturation? Default is TRUE.
Whether to print out the start and end time of the model +fitting. Default is FALSE.
Whether to return the computing time of the model +fitting. Default is TRUE.
An object with S3 class "biglasso"
with following variables.
A sparse matrix where rows are estimates a given coefficient across all values of lambda
A vector of length nlambda
containing the number of
+iterations until convergence
Vector of residuals calculated from estimated coefficients.
The sequence of regularization parameter values in the path.
Same as in `biglasso()`
A vector containing either the residual sum of squares of the fitted model at each value of lambda.
Same as in `biglasso()`.
The number of observations used in the model fitting.
The response vector used in the model fitting.
Of note, this function:
+* does NOT add an intercept + * does NOT standardize the design matrix + * does NOT set up a path for lambda (the lasso tuning parameter) automatically; + This vector of values must be user-supplied.
+This function is made for use in situations where these steps have already been addressed prior + to model fitting.
+In other words, `biglasso_path()` is doing the same thing as `biglasso_fit()`, + with the additional option to fit models across a path of tuning parameter values.
+For now, this function only works with linear regression (`family = 'gaussian'`)
+
+data(Prostate)
+X <- cbind(1, Prostate$X) |> ncvreg::std() # standardizing -> xtx is all 1s
+y <- Prostate$y
+X.bm <- as.big.matrix(X)
+init <- rep(0, ncol(X)) # using cold starts - will need more iterations
+r <- y - X%*%init
+fit_lasso <- biglasso_simple_path(X = X.bm, y = y, r = r, init = init,
+ xtx = rep(1, ncol(X)), lambda = c(0.5, 0.1, 0.05, 0.01, 0.001),
+ penalty.factor=c(0, rep(1, ncol(X)-1)),
+ max.iter = 10000)
+#> Error in biglasso_simple_path(X = X.bm, y = y, r = r, init = init, xtx = rep(1, ncol(X)), lambda = c(0.5, 0.1, 0.05, 0.01, 0.001), penalty.factor = c(0, rep(1, ncol(X) - 1)), max.iter = 10000): could not find function "biglasso_simple_path"
+
+fit_mcp <- biglasso_simple_path(X = X.bm, y = y, r = r, init = init,
+ xtx = rep(1, ncol(X)), lambda = c(0.5, 0.1, 0.05, 0.01, 0.001),
+ penalty.factor=c(0, rep(1, ncol(X)-1)),
+ max.iter = 10000, penalty= 'MCP')
+#> Error in biglasso_simple_path(X = X.bm, y = y, r = r, init = init, xtx = rep(1, ncol(X)), lambda = c(0.5, 0.1, 0.05, 0.01, 0.001), penalty.factor = c(0, rep(1, ncol(X) - 1)), max.iter = 10000, penalty = "MCP"): could not find function "biglasso_simple_path"
+
+
Simplified call to biglasso: a gaussian model fit with no 'bells and whistles' (e.g., no SSR)
Simplified call to biglasso: a gaussian model fit with no 'bells and whistles' (e.g., no SSR)