I have a matrix of values. I'd like to display a bar chart that represents the number of occurences as a function of values, but how to count the occurence of each value in a matrix?
Moreover, as these values are doubles, could you explain how to "group" them before (e.g.: [0,1[, [1,2[ ...) ?
Hello Nico, you can directly use our Histogram view or the Bar Chart from the JFreeChart integration to visualize the number of occurences. If you just care about the numbers, use the GroupBy node and COUNT operator in the Aggregation tab.
There is probably something I don't see.
With the Histogram view, I can not specify the bins as I want. "Number of bins" does not give "nice" bins ([0;1[, [1;2[ ...) and I do not really know which binning column I should use because I have more than 100 columns. In the best case I get intervals almost as I want ([0;0,967[, [0,967; 1,863[...), but for each bin I do not have the sum of each columns.
if you want to count the unique values per column you can use the Statistics node. The second output table contains per input column two result columns. The first contains the unique values and the second column their counts. Be aware that you might have to increase the number of possible values per column in the node dialog. If you only want to count the values that occur in a specific range you first need to bin the input columns using the Numeric Binner or Auto-Binner prior using the statistics node.
Thank you, I had forgotten the statistics node exists... With the Binner (Dictionnary) node I have created my owns bins and categorized every values of my matrix column by column. With the statistics node, I know the occurences of each bins in each column. But I'm still stuck to group the columns containing the bins and to sum the occurences for each of them.
Finally a small diagram of the result I expect:
bin_label1 | occurrence1 | bin_label2 | occurrence2
[0,1[ | 54 | [1,2[ | 37
[1,2[ | 14 | [2,3[ | 100
bin_label | occurence
[0,1[ | 54
[1,2[ | 51
[2,3[ | 100
Does anyone have a solution???