-
-
Notifications
You must be signed in to change notification settings - Fork 405
liquidSVM #2428
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
liquidSVM #2428
Changes from 1 commit
c13335a
8688547
15b2d0c
6ceb849
e6feccb
013b9cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,24 +5,24 @@ makeRLearner.classif.liquidSVM = function() { | |
| package = "liquidSVM", | ||
| par.set = makeParamSet( | ||
| makeIntegerLearnerParam(id = "d", lower = 0L), | ||
| makeLogicalLearnerParam(id = "scale", default = TRUE), | ||
| makeIntegerLearnerParam(id = "threads", default = 1L, lower = -1L), | ||
| makeIntegerLearnerParam(id = "partition_choice", default = 0L, lower = 0L), | ||
| makeIntegerLearnerParam(id = "grid_choice", default = 0L, lower = -2L, upper = 2L), | ||
| makeIntegerLearnerParam(id = "adaptivity_control", default = 0L, lower = 0L, upper = 2L), | ||
| makeIntegerLearnerParam(id = "random_seed", default = 1L), | ||
| makeLogicalLearnerParam(id = "scale"), | ||
|
||
| makeIntegerLearnerParam(id = "threads", lower = -1L), | ||
|
||
| makeIntegerLearnerParam(id = "partition_choice", lower = 0L), | ||
|
||
| makeIntegerLearnerParam(id = "grid_choice", lower = -2L, upper = 2L), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does this interact with
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And all of these options should be not tunable. |
||
| makeIntegerLearnerParam(id = "adaptivity_control", lower = 0L, upper = 2L), | ||
|
||
| makeIntegerLearnerParam(id = "random_seed", default = 1), | ||
|
||
| makeIntegerLearnerParam(id = "fold"), | ||
|
||
| makeIntegerLearnerParam(id = "clipping"), | ||
|
||
| makeIntegerLearnerParam(id = "gamma_steps", lower = 0), | ||
| makeNumericLearnerParam(id = "min_gamma", lower = 0), | ||
| makeNumericLearnerParam(id = "max_gamma", lower = 0), | ||
| makeNumericLearnerParam(id = "gamma", lower = 0), | ||
| makeNumericVectorLearnerParam(id = "gammas", lower = 0), | ||
| makeIntegerLearnerParam(id = "lambda_steps", lower = 0), | ||
| makeNumericLearnerParam(id = "min_lambda", lower = 0), | ||
| makeNumericLearnerParam(id = "max_lambda", lower = 0), | ||
| makeNumericLearnerParam(id = "lambdas", lower = 0), | ||
| makeNumericLearnerParam(id = "c_values", lower = 0), | ||
| makeLogicalLearnerParam(id = "useCells", default = FALSE) | ||
| makeNumericVectorLearnerParam(id = "lambdas", lower = 0), | ||
| makeNumericVectorLearnerParam(id = "c_values", lower = 0), | ||
| makeLogicalLearnerParam(id = "useCells") | ||
|
||
| ), | ||
| properties = c("twoclass", "multiclass", "numerics", "factors"), | ||
| name = "Support Vector Machines (liquidSVM)", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| context("classif_liquidSVM") | ||
|
|
||
| test_that("classif_liquidSVM", { | ||
| requirePackagesOrSkip("liquidSVM", default.method = "load") | ||
| parset.list = list( | ||
| list(), | ||
| list(partition_choice = 6), | ||
| list(partition_choice = 5), | ||
| list(grid_choice = 1), | ||
| list(grid_choice = 2), | ||
| list(adaptivity_control = 1), | ||
| list(adaptivity_control = 2), | ||
| list(clipping = -1), | ||
| list(clipping = 0), | ||
| list(gamma_steps = 5, min_gamma = 0.1, max_gamma = 25, lambda_steps = 5, min_lambda = 0.1, max_lambda = 25), | ||
| list(useCells = TRUE), | ||
| list(gammas = c(0.1,1,10), lambdas = c(0.1,1,10), c_values = c(0.1,1,10)) | ||
| ) | ||
| # Kernel, more advanced parameters... | ||
|
|
||
| old.predicts.list = list() | ||
| for (i in seq_along(parset.list)) { | ||
| parset = parset.list[[i]] | ||
| pars = list(x = multiclass.formula, y = multiclass.train) | ||
| pars = c(pars, parset) | ||
| set.seed(getOption("mlr.debug.seed")) | ||
| set.seed(123) | ||
| m = do.call(liquidSVM::svm, pars) | ||
| set.seed(getOption("mlr.debug.seed")) | ||
| set.seed(123) | ||
| p = predict(m, newdata = multiclass.test, type = "response") | ||
| old.predicts.list[[i]] = p | ||
| } | ||
|
|
||
| testSimpleParsets("classif.liquidSVM", multiclass.df, multiclass.target, | ||
| multiclass.train.inds, old.predicts.list, parset.list[1]) | ||
|
|
||
| }) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| context("regr_liquidSVM") | ||
|
|
||
| test_that("regr_liquidSVM", { | ||
| requirePackagesOrSkip("liquidSVM", default.method = "load") | ||
|
|
||
| parset.list = list( | ||
| list(), | ||
| list(partition_choice = 6), | ||
| list(partition_choice = 5), | ||
| list(grid_choice = 1), | ||
| list(grid_choice = 2), | ||
| list(adaptivity_control = 1), | ||
| list(adaptivity_control = 2), | ||
| list(clipping = -1), | ||
| list(clipping = 0), | ||
| list(gamma_steps = 5, min_gamma = 0.1, max_gamma = 25, lambda_steps = 5, min_lambda = 0.1, max_lambda = 25), | ||
| list(useCells = TRUE), | ||
| list(gammas = c(0.1,1,10), lambdas = c(0.1,1,10), c_values = c(0.1,1,10)) | ||
| ) | ||
| old.predicts.list = list() | ||
| for (i in seq_along(parset.list)) { | ||
| parset = parset.list[[i]] | ||
| pars = list(x = regr.formula, y = regr.train) | ||
| pars = c(pars, parset) | ||
| set.seed(getOption("mlr.debug.seed")) | ||
| m = do.call(liquidSVM::svm, pars) | ||
| p = predict(m, newdata = regr.test) | ||
| old.predicts.list[[i]] = p | ||
| } | ||
|
|
||
| testSimpleParsets("regr.liquidSVM", regr.df, regr.target, regr.train.inds, old.predicts.list, parset.list) | ||
| }) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be tunable (
tunable = FALSE).