How to fine tune using sensitivity

Hi I am new in KNIME and I don’t understand how to fine tune a machine learning model using a specific metric like sensitivity. One specific workflow that I think was to:

  1. use rule engine creating a column assigning 1 if true positive 0 otherwise and also create a column assigning 1 if false negative 0

  2. group by to compute all TP and FN in all the dataset

  3. math formula node to compute sensitivity in all dataset

  4. connecting math formula to parameter optimization loop end and maximize the sensitivity

But this workflow does not work so can you suggest me a functional approach to compute sensitivity to fine tune a model?

Also can I use the same approach to fine tune a random forest and a Knn?

Thank you but I really don’t know much about KNIME so any adivice or help would be very much appreciated