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

Hi,
have you tried the “Scorer” Node? In the second output, you can find the sensitivity calculation, so you do not have to to this manually.

I uploaded a toy model to my KNIME-Hub:

To get this optimization flow running, you need to define which Hyperparameter you want to adjust first. In my case it’s just a simple “number of models”.
Then you need to pass this parameter to the “Learner” node by enabling the corresponding setting in the “flow variables” pane.

Hi than you very much for the example but if I want to fine tune sensitivity using cross validation then I would also need the nodes X partitioner(right after parameter optimization loop start) and X aggregator(right after predictor and before scorer)? One more thing how can I see the parameter of the model after the fine tune procedure is over?

Yeah this can be done like you proposed.
See:

I updated the shared workflow:

2 Likes

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