Skip to content

Commit

Permalink
Clearing WARNINGS from CRAN checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyle Kim committed Jul 12, 2019
1 parent ba8d438 commit 0e5270f
Show file tree
Hide file tree
Showing 38 changed files with 144 additions and 134 deletions.
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
^cran-comments\.md$
^.*\.Rproj$
^\.Rproj\.user$
^sgd\.Rproj$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
*.Rdata
*.so
*.o
*.Rproj
.Rproj.user
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ Type: Package
Title: Stochastic Gradient Descent for Scalable Estimation
Version: 1.1.1
Authors@R: c(
person("Dustin", "Tran", email = "[email protected]", role = c("aut", "cre")),
person("Junhyung Lyle", "Kim", email = "[email protected]", role = c("cre", "aut")),
person("Dustin", "Tran", role = "aut"),
person("Panos", "Toulis", role = "aut"),
person("Tian", "Lian", role = "ctb"),
person("Ye", "Kuang", role = "ctb"),
person("Edoardo", "Airoldi", role = "ctb")
)
Maintainer: Dustin Tran <[email protected]>
Maintainer: Junhyung Lyle Kim <[email protected]>
Description: A fast and flexible set of tools for large scale estimation. It
features many stochastic gradient methods, built-in models, visualization
tools, automated hyperparameter tuning, model checking, interval estimation,
Expand All @@ -36,4 +37,4 @@ LinkingTo:
RcppArmadillo
LazyData: yes
VignetteBuilder: R.rsp
RoxygenNote: 6.1.0.9000
RoxygenNote: 6.1.1
18 changes: 3 additions & 15 deletions R/sgd.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,12 @@
#' Wei Xu. Towards optimal one pass large scale learning with averaged
#' stochastic gradient descent. arXiv preprint arXiv:1107.2490, 2011.
#'
#' # Dimensions
#' @examples
#' ## Linear regression
#' set.seed(42)
#' N <- 1e4
#' d <- 10
#' d <- 5
#' X <- matrix(rnorm(N*d), ncol=d)
#' theta <- rep(5, d+1)
#' eps <- rnorm(N)
Expand All @@ -171,25 +172,12 @@
#' sgd.theta <- sgd(y ~ ., data=dat, model="lm")
#' sprintf("Mean squared error: %0.3f", mean((theta - as.numeric(sgd.theta$coefficients))^2))
#'
#' ## Wine quality (Cortez et al., 2009): Logistic regression
#' set.seed(42)
#' data("winequality")
#' dat <- winequality
#' dat$quality <- as.numeric(dat$quality > 5) # transform to binary
#' test.set <- sample(1:nrow(dat), size=nrow(dat)/8, replace=FALSE)
#' dat.test <- dat[test.set, ]
#' dat <- dat[-test.set, ]
#' sgd.theta <- sgd(quality ~ ., data=dat,
#' model="glm", model.control=binomial(link="logit"),
#' sgd.control=list(reltol=1e-5, npasses=200),
#' lr.control=c(scale=1, gamma=1, alpha=30, c=1))
#' sgd.theta
#'
#' @useDynLib sgd
#' @import MASS
#' @importFrom methods new
#' @importFrom Rcpp evalCpp
#' @importFrom stats gaussian is.empty.model model.matrix model.response rnorm
#' @importFrom stats gaussian is.empty.model model.matrix model.response rnorm coef fitted predict

################################################################################
# Classes
Expand Down
24 changes: 24 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Test environments

* local OS X install, R 3.5.0
* win-builder (devel and release)


## R CMD check results
There were no ERRORs or WARNINGs.

There was 1 NOTE:

* checking CRAN incoming feasibility ... NOTE
Maintainer: ‘Junhyung Lyle Kim <[email protected]>

New submission

Package was archived on CRAN

CRAN repository db overrides:
X-CRAN-Comment: Archived on 2018-01-23 as check problems were not
corrected in time.

-> This is the new submission after fixing the check problems.

17 changes: 3 additions & 14 deletions man/sgd.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/Makevars
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
PKG_CPPFLAGS = -I.
PKG_CPPFLAGS = -I../inst/include -DARMA_DONT_PRINT_OPENMP_WARNING -DARMA_DONT_PRINT_CXX11_WARNING
CXX_STD = CXX11
3 changes: 2 additions & 1 deletion src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
PKG_CPPFLAGS = -I.
PKG_CPPFLAGS = -I../inst/include -DARMA_DONT_PRINT_OPENMP_WARNING -DARMA_DONT_PRINT_CXX11_WARNING
CXX_STD = CXX11
2 changes: 1 addition & 1 deletion src/data/data_point.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef DATA_DATA_POINT_H
#define DATA_DATA_POINT_H

#include "basedef.h"
#include "../basedef.h"

struct data_point {
/**
Expand Down
4 changes: 2 additions & 2 deletions src/data/data_set.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef DATA_DATA_SET_H
#define DATA_DATA_SET_H

#include "basedef.h"
#include "data/data_point.h"
#include "../basedef.h"
#include "data_point.h"

// wrapper around R's RNG such that we get a uniform distribution over
// [0,n) as required by the STL algorithm
Expand Down
4 changes: 2 additions & 2 deletions src/learn-rate/base_learn_rate.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef LEARN_RATE_BASE_LEARN_RATE_H
#define LEARN_RATE_BASE_LEARN_RATE_H

#include "basedef.h"
#include "learn-rate/learn_rate_value.h"
#include "../basedef.h"
#include "learn_rate_value.h"

class base_learn_rate {
/**
Expand Down
6 changes: 3 additions & 3 deletions src/learn-rate/ddim_learn_rate.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef LEARN_RATE_DDIM_LEARN_RATE_H
#define LEARN_RATE_DDIM_LEARN_RATE_H

#include "basedef.h"
#include "learn-rate/base_learn_rate.h"
#include "learn-rate/learn_rate_value.h"
#include "../basedef.h"
#include "base_learn_rate.h"
#include "learn_rate_value.h"

class ddim_learn_rate : public base_learn_rate {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/learn-rate/learn_rate_value.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef LEARN_RATE_LEARN_RATE_VALUE_H
#define LEARN_RATE_LEARN_RATE_VALUE_H

#include "basedef.h"
#include "../basedef.h"

class learn_rate_value {
/**
Expand Down
6 changes: 3 additions & 3 deletions src/learn-rate/onedim_eigen_learn_rate.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef LEARN_RATE_ONEDIM_EIGEN_LEARN_RATE_H
#define LEARN_RATE_ONEDIM_EIGEN_LEARN_RATE_H

#include "basedef.h"
#include "learn-rate/base_learn_rate.h"
#include "learn-rate/learn_rate_value.h"
#include "../basedef.h"
#include "base_learn_rate.h"
#include "learn_rate_value.h"

class onedim_eigen_learn_rate : public base_learn_rate {
/**
Expand Down
6 changes: 3 additions & 3 deletions src/learn-rate/onedim_learn_rate.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef LEARN_RATE_ONEDIM_LEARN_RATE_H
#define LEARN_RATE_ONEDIM_LEARN_RATE_H

#include "basedef.h"
#include "learn-rate/base_learn_rate.h"
#include "learn-rate/learn_rate_value.h"
#include "../basedef.h"
#include "base_learn_rate.h"
#include "learn_rate_value.h"

class onedim_learn_rate : public base_learn_rate {
/**
Expand Down
4 changes: 2 additions & 2 deletions src/model/base_model.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef MODEL_BASE_MODEL_H
#define MODEL_BASE_MODEL_H

#include "basedef.h"
#include "data/data_point.h"
#include "../basedef.h"
#include "../data/data_point.h"

class base_model {
/**
Expand Down
6 changes: 3 additions & 3 deletions src/model/cox_model.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef MODEL_COX_MODEL_H
#define MODEL_COX_MODEL_H

#include "basedef.h"
#include "data/data_point.h"
#include "model/base_model.h"
#include "../basedef.h"
#include "../data/data_point.h"
#include "base_model.h"

class cox_model : public base_model {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/glm/glm_family.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef MODEL_GLM_FAMILY_H
#define MODEL_GLM_FAMILY_H

#include "basedef.h"
#include "../../basedef.h"

class base_family;
class gaussian_family;
Expand Down
2 changes: 1 addition & 1 deletion src/model/glm/glm_transfer.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef MODEL_GLM_TRANSFER_H
#define MODEL_GLM_TRANSFER_H

#include "basedef.h"
#include "../../basedef.h"

class base_transfer;
class identity_transfer;
Expand Down
10 changes: 5 additions & 5 deletions src/model/glm_model.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef MODEL_GLM_MODEL_H
#define MODEL_GLM_MODEL_H

#include "basedef.h"
#include "data/data_point.h"
#include "model/base_model.h"
#include "model/glm/glm_family.h"
#include "model/glm/glm_transfer.h"
#include "../basedef.h"
#include "../data/data_point.h"
#include "base_model.h"
#include "glm/glm_family.h"
#include "glm/glm_transfer.h"

class glm_model : public base_model {
/**
Expand Down
6 changes: 3 additions & 3 deletions src/model/gmm_model.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef MODEL_GMM_MODEL_H
#define MODEL_GMM_MODEL_H

#include "basedef.h"
#include "data/data_point.h"
#include "model/base_model.h"
#include "../basedef.h"
#include "../data/data_point.h"
#include "base_model.h"

class gmm_model : public base_model {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/m-estimation/m_loss.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef MODEL_M_LOSS_H
#define MODEL_M_LOSS_H

#include "basedef.h"
#include "../../basedef.h"

class base_loss;
class huber_loss;
Expand Down
8 changes: 4 additions & 4 deletions src/model/m_model.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef MODEL_M_MODEL_H
#define MODEL_M_MODEL_H

#include "basedef.h"
#include "data/data_point.h"
#include "model/base_model.h"
#include "model/m-estimation/m_loss.h"
#include "../basedef.h"
#include "../data/data_point.h"
#include "base_model.h"
#include "m-estimation/m_loss.h"

class m_model : public base_model {
/**
Expand Down
6 changes: 3 additions & 3 deletions src/post-process/cox_post_process.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef POST_PROCESS_COX_POST_PROCESS_H
#define POST_PROCESS_COX_POST_PROCESS_H

#include "basedef.h"
#include "data/data_set.h"
#include "model/cox_model.h"
#include "../basedef.h"
#include "../data/data_set.h"
#include "../model/cox_model.h"

template <typename SGD>
Rcpp::List post_process(const SGD& sgd, const data_set& data,
Expand Down
6 changes: 3 additions & 3 deletions src/post-process/glm_post_process.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef POST_PROCESS_GLM_POST_PROCESS_H
#define POST_PROCESS_GLM_POST_PROCESS_H

#include "basedef.h"
#include "data/data_set.h"
#include "model/glm_model.h"
#include "../basedef.h"
#include "../data/data_set.h"
#include "../model/glm_model.h"

template <typename SGD>
Rcpp::List post_process(const SGD& sgd, const data_set& data,
Expand Down
6 changes: 3 additions & 3 deletions src/post-process/gmm_post_process.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef POST_PROCESS_GMM_POST_PROCESS_H
#define POST_PROCESS_GMM_POST_PROCESS_H

#include "basedef.h"
#include "data/data_set.h"
#include "model/gmm_model.h"
#include "../basedef.h"
#include "../data/data_set.h"
#include "../model/gmm_model.h"

// model.out: flag to include weighting matrix
template <typename SGD>
Expand Down
6 changes: 3 additions & 3 deletions src/post-process/m_post_process.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef POST_PROCESS_M_POST_PROCESS_H
#define POST_PROCESS_M_POST_PROCESS_H

#include "basedef.h"
#include "data/data_set.h"
#include "model/m_model.h"
#include "../basedef.h"
#include "../data/data_set.h"
#include "../model/m_model.h"

template <typename SGD>
Rcpp::List post_process(const SGD& sgd, const data_set& data,
Expand Down
10 changes: 5 additions & 5 deletions src/sgd/base_sgd.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef SGD_BASE_SGD_H
#define SGD_BASE_SGD_H

#include "basedef.h"
#include "learn-rate/base_learn_rate.h"
#include "learn-rate/onedim_learn_rate.h"
#include "learn-rate/onedim_eigen_learn_rate.h"
#include "learn-rate/ddim_learn_rate.h"
#include "../basedef.h"
#include "../learn-rate/base_learn_rate.h"
#include "../learn-rate/onedim_learn_rate.h"
#include "../learn-rate/onedim_eigen_learn_rate.h"
#include "../learn-rate/ddim_learn_rate.h"

class base_sgd {
/**
Expand Down
Loading

0 comments on commit 0e5270f

Please sign in to comment.