Pre-process column in a CellFactory

Hello everybody,

I am a new knime developer. My first project consists of a binner that will apply some known discretization methods on some selected columns. The problem with these methods is that their criterion is a posteriori and depends on the columns being discretized.

The example that comes with the documentation is slightly different from my purpose, since the method getCell applies directly some criterion that does not depend on the column data.

In my case, I would need to pre-process some columns in order to provide my CellFactory with all the necessary parameters. I guess that I should put some code in execute method, right before I use CellFactories. I would not need very detailed information about the column, just the following kind of things:

  • min and max values.
  • number of elements.

My specficic question is what class would provide that information in the execute method. Thanks!

Minimum and maximum for a column are stored in the respective DataColumnSpec. However, these values may not reflect the true minimum and maximum because not all nodes (e.g. row filter) update the domain values. The interval in the spec may be larger than in the actual data. If you want to compute the values by yourself you can use org.knime.base.data.statistics.StatisticCalculator.

The number of elements (I guess you mean the row count) is a property of the BufferedDataTable (getRowCount()).