Parameter Optimization for Multiclass model

Hi everyone,

I know about the use of the parameter optimization loop in KNIME. I’ve seen that it is possible to use this for a multiclass target variabele if you want to maximize the accuracy. However, I was wondering if it’s also possible to perform an optimisation loop, given that the objection function you want to maximize is the AUC (so in this case, the average AUC for each of the classes).

Kind regards,

Hi @jeandony,

in the end the Parameter Optimization Loop simply optimizes the value of a flow variable (whether larger or smaller values are optimal is configured in the Parameter Optimization Loop End).
Therefore the challenge is rather how to obtain the average AUC.
If you always have the same classes, you can go with a chain of ROC Curve nodes, one for each class but this approach requires adjustments whenever the classes change.
As an alternative, you can also have a loop inside your Parameter Optimization Loop that calculates the AUC and finally calculates the mean.

Kind regards,
Adrian

1 Like

Hi @nemad,

Thanks for your answer. Could you please explain how you can obtain the average AUC and then maximize the average AUC?

Kind regards,

Hi @jeandony,

sorry for the delay, this turned out to be a lot trickier than I expected, so I created a small component that should do the trick:


The workflow shows how to use the component for some generated data but it should work just as well in your workflow.

Kind regards,
Adrian

2 Likes

Hi @nemad,

I’ve solved this in another way. I just used k (k being the number of classes the target variable has) ROC Curve nodes to calculate the AUC for each class. After that I used k-1 concatenate nodes to place the AUCs in the same table, after which I used a math formula node to calculate the mean of the AUC column. This column was then converted to a variable using the "table row to variable"node which you can maximize using the optimization loop.

Kind regards,

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.