The output of the Linear correlation node looks like this:
How can I easily pick all the “Eagles” correlations? I could filter both the first and the second column and then concatenate them together, but then “Rabbits” and “Starbucks” names end up in different columns which makes life hard further down the line. To avoid this trouble, I very often end up doing this:
with the Column Rename node config:
Now I only need to filter the first column to get all the Eagle correlations, and the second column will contain all the correlation partners.
I therefore suggest to add an option “symmetrical output” to the Linear Correlation and Rank Correlation nodes.
(I know I could use a column filter on the correlation matrix, but that does not give me the p-value)
Your first suggestion is basically what i wrote in my suggestion: “I could filter both the first and the second column and then concatenate them together,” but then without the need for concatenation, which is nice. I would need OR though, not AND. There would never be a row with Eagles in both columns, I need rows with Eagles in either column.
However, it still means that the other correlation variable name is not in its own column, which makes life difficult in subsequent nodes. This is what I meant when I wrote: “but then “Rabbits” and “Starbucks” names end up in different columns which makes life hard further down the line.”
I don’t see how the table editor could help me here.
Hi @Aswin ,
it is a bit hard to understand the task and provide a solution without the WF at hand, so I could try it out myself. If the suggestion below do not help, please, upload your WF, if possible.
The Row Filter (Labs) also allows OR condition. I just gave you an example of what is possible and yes, indeed, you need an OR condition in this case
With Table Editor node you could manually “swap” Rabbits and Eagles in the Row0. That should get you what you want to have: 3 rows with Eagles in one column, if I understood your goal correctly.
This is just a suggestion to make it easier for you for now, but maybe somebody provides a better idea.
I already have a solution to my problem, it is the one that I showed in my first post. It works fine. The purpose of my post was just to make a suggestion how the Linear Correlation node could be slightly changed to make its output more convenient to use.
I thought more KNIME users that work with the Linear Correlation node must have this issue, but I could be mistaken. Maybe I did not make my use-case clear enough.
It is not a big issue. I will simply continue to use the Linear Correlation node (and the Rank Correlation node) the way I presented in my first post. I post quite a lot of feature suggestions here, I do not expect all of them to be implemented.
I have anyway attached the workflow for completeness sake.
Hi @Aswin ,
sure, your feedback is in the voting process now but it might take a while. I just though to share with you the way I would go around it for now with a lesser amount of nodes to use
Thanks for attaching the WF and have a nice day!