Damiano
Damiano

Reputation: 21

liquidSVM parameter selection clarification in R

This is my first question and i'm only a basic "programmer" so i'm sorry if i do not make myself clear enough.

I'm currently using liquidSVM 1.2.1 on R 3.5.0 and, despite its great potential i do not understand some technicisms, as the help is not explanatory enough for me and i cannot find anything on the internet. More specifically I'd like to understand further how the parameter selection works.

The final liquidSVM model contains in fact info on gammas and lambdas but i cannot understand if these parameters are all being used in different cells or if just a final couple has been chosen for the final model. These leads to 2 sub-questions:

  1. If using all the values, how can i disable grid_choice and select only a value for each parameter?
  2. If the algorithm selects a final couple of values, how can i understand which one it is?

This is the setting i've been using so far:

model = liquidSVM:: svm(formula, TRAIN, threads = 3, predict.prob = T, random_seed = 123, folds = 5, scale = F, d = 1, partition_choice = 5, grid_choice = -1)

I tried different things, for example:

  1. setting gamma = 0.01 and lambda = 0.1;
  2. setting max_gamma = 0.01 and min_gamma = 0.01
  3. setting grid_choice = NULL or grid_choice = list(gamma = 0.01, lambda = 0.01)

but it still does a grid selection on its own.

If only i could understand how to disable this grid search and provide my chosen parameters, i'd code a grid search by myself (thus knowing what the code is doing).

Thank you in advance.

Upvotes: 2

Views: 205

Answers (1)

Christopher C.
Christopher C.

Reputation: 11

The question is somewhat older now. However, if someone is still looking for a corresponding solution.

You can define your grid in which to be searched for the best matching values by using the arguments called gammas and lambdas. In this case you set them to one value.

For example:

model <- svm(x1~., train, display=1,folds=5, mc_type="OvA_ls",
              gammas = 0.01,
              lambdas = 0.1
)

would set the gamma to only 0.01 and the lambda to 0.1.

However this is not a grid search anymore and you should expect to get two hands full of warning messages. If you provide a vector of gammas and a vector of lambdas it will search that set grid rather than the default. Hence the arguments can be handy if you want to compare liquidSVM with other packages for example.

Best luck

Upvotes: 1

Related Questions