How to export regression models inside the group loop

Hello all,

Please help me.
I want to export my Random Forest Models, but the models is looping for every code and channel. How can I export the model out for every loop at the same time. I gave the screenshot to give some sense about it. Thank you

Hi,
Welcome to the KNIME Forum! You can use a flow variable to dynamically change the file name that the Model Writer node uses. For that you can use a Create File/Folder Variables node like in this example: Controlling the output loacetion in a loop (new file handling) – KNIME Community Hub.
Let me know if you have any questions about this!
Kind regards,
Alexander

2 Likes

Hello, can you give me the example of the workflow, assuming that I want to save my random forest models? Which should be connected to which nodes, thankyou

Hello @ardyaksa,

To dynamically change the writer file name, you can utilize a “Create File/Folder” node. For your reference, I have attached an image.

Screenshot 2024-03-14 142534

Screenshot 2024-03-14 143530

2 Likes

Hi,
Instead of the CSV Writer, you have a Model Writer. So you connect the Create File/Folder Variables node to the Group Loop Start and to the Model Writer. But you also need to configure the Create File/Folder Variables and the Model Writer correctly, using flow variables. To figure that out, I recommend watching the video I linked and downloading and inspecting the example workflow.
Kind regards,
Alexander

Thank you so much for the reply