There is a new KNIME forum. You can still browse and read content from our old forum but if you want to create new posts or join ongoing discussions, please visit our new KNIME forum: https://forum.knime.com

Trapping node errors to allow loop continuation

Member for

3 years 4 months holmes

Is there any way to trap node errors to allow loop continuation?

Here's my scenario:

I have a data set containing all employee performance, and I'm looping through each individual employee to predict performance using several techniques for the purpose of understanding which technique works best for each individual.  Invariably an error will occur at some point on some technique, and the message is always nebulous (ERROR Polynomial Regression Learner 9:407      Execute failed: Index: 4, Size: 4).  

Typically I just remove this method so the loop can continue, but I'd prefer not to do that because it can be time consuming.  I'd prefer to automate but I can't figure it out.  Any ideas?

On a related note, is there a place where these types of errors are documented?  Is there a guideline for understanding what the message is telling me?  I'm experiencing them on various mining/regression learners and the messages usually indicate some index violation.

Thanks!

Brian

Comments
Wed, 06/22/2016 - 11:54

Member for

3 years 6 months

marco_ghislanzoni

Hi holmes,

did you consider using the Try and Catch nodes for your scenario? They help to trap errors by executing an alternative path when that happens. There are few variations of them depending on the use case.

Regarding the interpretation of the errors from the learner/predictor nodes, you can usually get more details by increasing the logging level in the console (not recommended) and/or in the log file (recommended). 

Here is how to do it:

---------------------------------------------

If you want to change the level of detail (either of the log file or of the console view) go to
File/Preferences.../KNIME for the level of detail of the log file or to
File/Preferences.../KNIME/KNIME GUI for the level of detail of the console view.

You can choose between:

DEBUG

Debug messages mainly used for development. It is not recommended to use this for the console view since it slows down KNIME.

INFO

Logs information messages. Not really important but also not completely useless!

WARNING

If a node fails in configure a warning message is also issued. Warning messages are not fatal; usually the workflow can continue to be executed but they denote that something worth to knowing about has taken place. Default and recommended level for the console view.

ERROR

Only issued when something fatal has happened, i.e. the workflow can no longer be executed.

-------------------------------------------------

In general those errors depend on your data (missing values, too few data points etc.), the node configuration (wrong parameters), or a combination of both.

If you don't spot your issues you can always post again in this forum to get support with it, but usually that requires sharing the faulty workflow and at least some test data (which you can always anonymize first if they contain sensitive information).

Cheers,
Marco.

 

Thu, 06/23/2016 - 04:28

Member for

3 years 4 months

holmes

Thanks for your quick response.  Is there an example that shows how to use try-catch with a learner node?

Regarding the error logging, it looks like default log level is error on gui and debug on file, which is what you're suggesting (I think).  But I can't find the error logs.  I've scoured the default directory but there's nothing that matches my workflow name and no files that match timestamps.  Any guidance here?

Thu, 06/23/2016 - 10:00

Member for

3 years 6 months

marco_ghislanzoni

Hi,

please see the attached example I just created to illustrate how error handling works.

The learner is in between a Try and a Catch node. If the learner triggers an error, the result of the alternative branch is sent to the output instead of the one from the main branch.

In this example, to trigger the error in the learner, just remove any value from the X column in the input data to generate a missing value (and do not change the configuration of the learner to automatically handle missing values otherwise the error will not be triggered).

You will see that the learner triggers an error but the workflow executes to the end and the output is still valid as it comes from the fall-back branch.

Regarding the Log file, you can display it within KNIME by choosing View --> Open KNIME Log

Hope this helps.

Cheers,
Marco.

Thu, 06/23/2016 - 06:40

Member for

3 years 4 months

holmes

That worked perfectly...thanks!  Thanks for the solution, the quick responses, all the detail, everything...thanks!

Thu, 06/23/2016 - 07:47

Member for

3 years 6 months

marco_ghislanzoni

My pleasure! :-)

Cheers,
Marco.