Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An R package for large scale estimation with stochastic gradient descent

NotificationsYou must be signed in to change notification settings

airoldilab/sgd

Repository files navigation

sgd is an R package for largescale estimation. It features many stochastic gradient methods, built-in models,visualization tools, automated hyperparameter tuning, model checking, intervalestimation, and convergence diagnostics.

Features

At the core of the package is the function

sgd(formula, data, model, model.control, sgd.control)

It estimates parameters for a given data set and model using stochastic gradientdescent. The optional argumentsmodel.control andsgd.control specifyattributes about the model and stochastic gradient method. Taking advantage ofthe bigmemory package, sgd also operates on data sets which are too large to fitin RAM as well as streaming data.

Example of large-scale linear regression:

library(sgd)# DimensionsN <- 1e5  # number of data pointsd <- 1e2  # number of features# Generate data.X <- matrix(rnorm(N*d), ncol=d)theta <- rep(5, d+1)eps <- rnorm(N)y <- cbind(1, X) %*% theta + epsdat <- data.frame(y=y, x=X)sgd.theta <- sgd(y ~ ., data=dat, model="lm")

Any loss function may be specified. For convenience the following arebuilt-in:

  • Linear models
  • Generalized linear models
  • Method of moments
  • Generalized method of moments
  • Cox proportional hazards model
  • M-estimation

The following stochastic gradient methods exist:

  • (Standard) stochastic gradient descent
  • Implicit stochastic gradient descent
  • Averaged stochastic gradient descent
  • Averaged implicit stochastic gradient descent
  • Classical momentum
  • Nesterov's accelerated gradient

Check out the vignette invignettes/ or examples indemo/.In R, the equivalent commands arevignette(package="sgd") anddemo(package="sgd").

Installation

To install the latest version from CRAN:

install.packages("sgd")

To install the latest development version from Github:

# install.packages("devtools")devtools::install_github("airoldilab/sgd")

Authors

sgd is written byDustin Tran,Junhyung Lyle Kim andPanos Toulis. Please feel free to contribute bysubmitting any issues or requests—or by solving any current issues!

We thank all other members of the Airoldi Lab (led by Prof. Edo Airoldi) for their feedback and contributions.

Citation

@article{tran2015stochastic,  author = {Tran, Dustin and Toulis, Panos and Airoldi, Edoardo M},  title = {Stochastic gradient descent methods for estimation with large data sets},  journal = {arXiv preprint arXiv:1509.06459},  year = {2015}}

About

An R package for large scale estimation with stochastic gradient descent

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors6


[8]ページ先頭

©2009-2025 Movatter.jp