Optimisation of SVM parameters


I would like to optimise the parameters of the SVR to get the highest R2 for my model. I tried to follow some tutorials here. But my workflow is still not working.

I put my trainer and learner between the strat and end of an optimisation loop.

Could you please help me to fix it?



Hello zizoo,

can you upload an example workflow? That would make it much easier to help you because from your text I can only guess what might be the problem
If you don't want to upload your full workflow, just upload the part that contains the optimization loop, you can even replace your data with e.g. the ouput of a "Data Generator".

If that's not possible then I would check if you replace the right parameters with flow variables.



Hi Nemad,
I am trying to optimise the hyperparameters of the weka SVM run with cross validation.
I attached a part of my worksheet. I used data generator and I got the following error:
WARN LibSVM (3.7) 6:271 Unable to merge flow object stacks: Conflicting FlowObjects: <Loop Context (Head 6:323, Tail unassigned)> - iteration 0 vs. <Loop Context (Head 6:281, Tail unassigned)> - iteration 0 (loops/scopes not properly nested?)

I tried also with simple partition function(without cross validation) and it is not working too. I the flow variable I cannot see properly the parameters of the weka svm nd also they seem to be all strings.

Hi again, with some try and test. I managed to get it run but I am not sure if the workflow is correct in this way. I attached a picture.

Hi zizoo, yes this why it should work correctly. Loops is Knime need to be opened and ended in correct order. eg. inner loop must end before outer loop.

Hi again,
I adjusted a bit the workflow as shown below. I practically added a row and a column filter to get the value of the accuracy of the average from the cross validation. I am not sure which one is correct.
I found a difference in the result of the optimization end loop.

Hello @zizoo,

what’s correct really depends on what you want to achieve.
But I guess your goal is to find the parameters that give you optimal accuracy of your model, in which case your workflow is correct.
Just a quick note: You actually don’t need the row and column filter because the Scorer node already outputs the accuracy as flow variable. Simply connect the Scorer with the Parameter Optimization Loop End via the red flow variable connection and you are good to go.