problem with loop

Hi,

I’ve meet a problem as I runing a counting loop for 10-fold crossvalidation for naive bayes classification…
The loop stopped many times like this (as in the following picture)…


I have tried serveral times to click the loop end and continue to run it but it has then results for more than 10 iteration (sometimes 11, sometimes 15 …)
I used the node monitor to controll the loop and it said that the currentiteration at the end is 9…
could anyone tell me how can i solve this problem? thanks.

Kind Regards,
N.

The currentIteration value is an internal value and like in the programming counted from 0, this is why the 10th iteration is called iteration 9:

Regarding your other problem, this looks very strange and clearly should not happen. Can you provide us with an example workflow so we can figure out what is going wrong?
best,
Gabriel

Hi Gabriel,

Thanks for the reply. I’ve understood what current iteration means and it turned out at the end except the loop end node, all the nodes bevor are 10 times iterated …
i attached a test workflow here.
https://drive.google.com/file/d/1a4F28q2VFBf5ogn3-sFcK0Ev0KlKZOhk/view?usp=sharing .

best Regards,
N.

Hi @Northern,

from your screenshot picture it seems that the Meta Node “Feature Selection&Elimination” has still nodes that are running or waiting for something (indicated by the watch icon). Maybe have a look if there is a sub-branch of your workflow that is still running while the other nodes of your main workflow have finished. This might be the reason why the Loop Node waits for completion. If so, remove the sub-branch and try again. But i’m just guessing.

Greets,
Michael

Hi Michael,

I’ve checked and all the sub-branches were finished runing…I’ve tried the same with the same datasets by some other methods, they can run unproblematically…
I’ve met same situation many times, e.g. sometimes with another dataset one other method (e.g. decision tree) couldn’t run directly 10 times in the first run…when I manually start the loop end it continue to run…but at the end I get more rows as I expected…I have no idea about the reason of that…

best,
N.

Hi @Northern,

when i remove the unused (unattached) Backward Feature Elimination Metanode from your Feature Selection&Elimination Metanode the Loop terminates. I think removing the Backward Feature Elimination is the solution, but i don’t really know why this happens and i don’t think it is ment to behave that way. Hope this helps.

1 Like

Off-topic but there actually are nodes fro cross-validation available:

image

X-Partitioner and X-Aggregator plus a Meta Node with a usage example.

4 Likes

Hallo,
I know this node and I’ve tried it… but I have a nested crossvalidation here…with this meta nodes I cannot generate the results I want and there’s at the x-Aggregator node.

Best regards,
N.