Skip to content

Commit 9673500

Browse files
committed
export S3 methods of predict
1 parent 0ab8cf6 commit 9673500

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Generated by roxygen2: do not edit by hand
22

33
S3method(predict,kfold)
4+
S3method(predict,lm2)
5+
S3method(predict,ranger)
46
S3method(previous_tn,data.frame)
57
S3method(previous_tn,default)
68
S3method(print,kfold)

R/kford_ml.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ kfold_lm <- function(X, Y, kfold = 5, ...) {
5151

5252
# rewrite ranger function
5353
# ' @import randomForest
54+
#' @export
5455
predict.ranger <- function(object, data = NULL, ...) {
5556
ranger:::predict.ranger(object, data, ...)$predictions
5657
}
@@ -68,6 +69,8 @@ ranger <- function(x, y, ntree = 500, ...) {
6869
ans
6970
}
7071

72+
73+
#' @export
7174
predict.lm2 <- function(object, data = NULL, ...) {
7275
ysim = cbind(1, data) %*% as.matrix(object$coefficients)
7376
ysim[, 1]

0 commit comments

Comments
 (0)