Skip to content

Commit fb6e19f

Browse files
committed
Expanded error checking in learner
1 parent b28b387 commit fb6e19f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

R/learner.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ learner <- function(Y_source, Y_target, r, lambda_1, lambda_2, step_size,
5959
if (any(is.na(Y_source))){
6060
stop('Y_source cannot have NA values.')
6161
}
62+
if (length(lambda_1) > 1){
63+
stop('lambda_1 must be a scalar. See the function cv.learner for selecting a suitable lambda_1 value.')
64+
}
65+
if (length(lambda_2) > 1){
66+
stop('lambda_2 must be a scalar. See the function cv.learner for selecting a suitable lambda_2 value.')
67+
}
6268

6369
## Setting the rank and other parameters
6470
missing <- any(is.na(Y_target))

0 commit comments

Comments
 (0)