Skip to content

Commit

Permalink
update to new Matrix syntax (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cortes authored Jan 10, 2021
1 parent b30d48d commit 4cb4477
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ LazyData: true
ByteCompile: true
Depends: R (>= 3.6.0), methods
Imports:
Matrix (>= 1.2),
Matrix (>= 1.3),
Rcpp (>= 0.11),
data.table (>= 1.10.0),
float (>= 0.2-2),
Expand Down
5 changes: 2 additions & 3 deletions R/model_FTRL.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
#' x = sample(c(-1, 1), 1000 * 100, TRUE)
#' odd = seq(1, 99, 2)
#' x[i %in% which(y == 1) & j %in% odd] = 1
#' m = sparseMatrix(i = i, j = j, x = x, dims = c(1000, 1000), giveCsparse = FALSE)
#' x = as(m, "RsparseMatrix")
#' x = sparseMatrix(i = i, j = j, x = x, dims = c(1000, 1000), repr="R")
#'
#' ftrl = FTRL$new(learning_rate = 0.01, learning_rate_decay = 0.1,
#' lambda = 10, l1_ratio = 1, dropout = 0)
Expand All @@ -21,7 +20,7 @@
#' w = ftrl$coef()
#' head(w)
#' sum(w != 0)
#' p = ftrl$predict(m)
#' p = ftrl$predict(x)
#' @export
FTRL = R6::R6Class(
classname = "FTRL",
Expand Down

0 comments on commit 4cb4477

Please sign in to comment.