Skip to content

Commit

Permalink
more input validations using hardhat (#166)
Browse files Browse the repository at this point in the history
Signed-off-by: Yitao Li <[email protected]>
  • Loading branch information
yitao-li authored Oct 25, 2021
1 parent a3faca5 commit 5e93751
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions R/knn.R
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ cuda_ml_knn.recipe <- function(x, data,
}

cuda_ml_knn_bridge <- function(processed, algo, metric, p, neighbors) {
hardhat::validate_predictors_are_numeric(processed$predictors)
hardhat::validate_outcomes_are_univariate(processed$outcomes)
x <- as.matrix(processed$predictors)
y <- processed$outcomes[[1]]
Expand Down
1 change: 1 addition & 0 deletions R/rand_forest.R
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ cuda_ml_rand_forest_bridge <- function(processed, mtry, trees, min_n, bootstrap,
min_samples_leaf, split_criterion,
min_impurity_decrease, max_batch_size,
n_streams, cuML_log_level) {
hardhat::validate_predictors_are_numeric(processed$predictors)
hardhat::validate_outcomes_are_univariate(processed$outcomes)
x <- as.matrix(processed$predictors)
y <- processed$outcomes[[1]]
Expand Down
1 change: 1 addition & 0 deletions R/svm.R
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ cuda_ml_svm.recipe <- function(x, data, cost = 1,
cuda_ml_svm_bridge <- function(processed, cost, kernel, gamma, coef0, degree, tol,
max_iter, nochange_steps, cache_size, epsilon,
sample_weights, cuML_log_level) {
hardhat::validate_predictors_are_numeric(processed$predictors)
hardhat::validate_outcomes_are_univariate(processed$outcomes)
x <- as.matrix(processed$predictors)
y <- processed$outcomes[[1]]
Expand Down

0 comments on commit 5e93751

Please sign in to comment.