Dear KNIME users,
I am already trying 4th snippet node to cope with my problem, and it seems with no luck. The problem is very simple: my workflow calculates classification model statistics. Using Value counter node, I obtain the number of 0s and 1s observed in my subset. Then the stats are calculated accorrdingly, assuming that both values are available. In rare examples, there are either no 1s or no 0s at all, and in these cases my calculations are halted.
The normal table looks like:
rowID count
0.0 20
1.0 10
So my question is: is there a way to conditionally insert new row / column(after transposing) with value 0 for all rows (in my case, always 1 row) if one of the rowIDs is not present? In all the snippets I tried implementing, there is always a problem with checking for existence of the columns I am making reference to in my code. For instance, the following Java code cannot be compiled due to "Invalid settings: No such column: 1.0":
Method body
Integer number = 0;
if($1.0$ != null) {
number = $1.0$;
}
return number;
Is there a way to skip this check, or perhaps to reference the column in the native Java way, or other, KNIME-friendly way to check for existence of column "1.0"? If there was better documentation of the node, I would solve this problem myself but the internals of the snippet class are unknow to me to see how the available variables are referenced with these $something$.
Your help will be greatly appreciated
indykpol