Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R] change internal calls to use keyword args #267

Merged
merged 4 commits into from
Nov 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions R-package/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## RGF 1.0.5.1

* Source files were broken up into one file per exported object as of [#266](https://github.com/RGF-team/rgf/pull/266)
* Internal calls to estimator constructors were changed to use keyword, instead of positional, arguments. [#267](https://github.com/RGF-team/rgf/pull/267)

## RGF 1.0.5

Expand Down
36 changes: 18 additions & 18 deletions R-package/R/FastRGF_Classifier.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,24 +151,24 @@ FastRGF_Classifier <- R6::R6Class(
# initialize FastRGF_Classifier
#------------------------------
private$rgf_init = RGF_mod$FastRGFClassifier(
as.integer(n_estimators)
, as.integer(max_depth)
, as.integer(max_leaf)
, tree_gain_ratio
, min_samples_leaf
, loss
, l1
, l2
, opt_algorithm
, learning_rate
, max_bin
, min_child_weight
, data_l2
, as.integer(sparse_max_features)
, as.integer(sparse_min_occurences)
, calc_prob
, as.integer(n_jobs)
, as.integer(verbose)
n_estimators = as.integer(n_estimators)
, max_depth = as.integer(max_depth)
, max_leaf = as.integer(max_leaf)
, tree_gain_ratio = tree_gain_ratio
, min_samples_leaf = min_samples_leaf
, loss = loss
, l1 = l1
, l2 = l2
, opt_algorithm = opt_algorithm
, learning_rate = learning_rate
, max_bin = max_bin
, min_child_weight = min_child_weight
, data_l2 = data_l2
, sparse_max_features = as.integer(sparse_max_features)
, sparse_min_occurences = as.integer(sparse_min_occurences)
, calc_prob = calc_prob
, n_jobs = as.integer(n_jobs)
, verbose = as.integer(verbose)
)
}
)
Expand Down
32 changes: 16 additions & 16 deletions R-package/R/FastRGF_Regressor.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,22 +139,22 @@ FastRGF_Regressor <- R6::R6Class(
# initialize FastRGF_Regressor
#-----------------------------
private$rgf_init <- RGF_mod$FastRGFRegressor(
as.integer(n_estimators)
, as.integer(max_depth)
, as.integer(max_leaf)
, tree_gain_ratio
, min_samples_leaf
, l1
, l2
, opt_algorithm
, learning_rate
, max_bin
, min_child_weight
, data_l2
, as.integer(sparse_max_features)
, as.integer(sparse_min_occurences)
, as.integer(n_jobs)
, as.integer(verbose)
n_estimators = as.integer(n_estimators)
, max_depth = as.integer(max_depth)
, max_leaf = as.integer(max_leaf)
, tree_gain_ratio = tree_gain_ratio
, min_samples_leaf = min_samples_leaf
, l1 = l1
, l2 = l2
, opt_algorithm = opt_algorithm
, learning_rate = learning_rate
, max_bin = max_bin
, min_child_weight = min_child_weight
, data_l2 = data_l2
, sparse_max_features = as.integer(sparse_max_features)
, sparse_min_occurences = as.integer(sparse_min_occurences)
, n_jobs = as.integer(n_jobs)
, verbose = as.integer(verbose)
)
}
)
Expand Down
34 changes: 17 additions & 17 deletions R-package/R/RGF_Classifier.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,23 +158,23 @@ RGF_Classifier <- R6::R6Class(
# initialize RGF_Classifier
#--------------------------
private$rgf_init <- RGF_mod$RGFClassifier(
as.integer(max_leaf)
, as.integer(test_interval)
, algorithm
, loss
, reg_depth
, l2
, sl2
, normalize
, min_samples_leaf
, n_iter
, as.integer(n_tree_search)
, as.integer(opt_interval)
, learning_rate
, calc_prob
, as.integer(n_jobs)
, memory_policy
, as.integer(verbose)
max_leaf = as.integer(max_leaf)
, test_interval = as.integer(test_interval)
, algorithm = algorithm
, loss = loss
, reg_depth = reg_depth
, l2 = l2
, sl2 = sl2
, normalize = normalize
, min_samples_leaf = min_samples_leaf
, n_iter = n_iter
, n_tree_search = as.integer(n_tree_search)
, opt_interval = as.integer(opt_interval)
, learning_rate = learning_rate
, calc_prob = calc_prob
, n_jobs = as.integer(n_jobs)
, memory_policy = memory_policy
, verbose = as.integer(verbose)
)
}
)
Expand Down
30 changes: 15 additions & 15 deletions R-package/R/RGF_Regressor.R
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,21 @@ RGF_Regressor <- R6::R6Class(
# initialize RGF_Regressor
#------------------------
private$rgf_init <- RGF_mod$RGFRegressor(
as.integer(max_leaf)
, as.integer(test_interval)
, algorithm
, loss
, reg_depth
, l2
, sl2
, normalize
, min_samples_leaf
, n_iter
, as.integer(n_tree_search)
, as.integer(opt_interval)
, learning_rate
, memory_policy
, as.integer(verbose)
max_leaf = as.integer(max_leaf)
, test_interval = as.integer(test_interval)
, algorithm = algorithm
, loss = loss
, reg_depth = reg_depth
, l2 = l2
, sl2 = sl2
, normalize = normalize
, min_samples_leaf = min_samples_leaf
, n_iter = n_iter
, n_tree_search = as.integer(n_tree_search)
, opt_interval = as.integer(opt_interval)
, learning_rate = learning_rate
, memory_policy = memory_policy
, verbose = as.integer(verbose)
)
}
)
Expand Down