Impute missing value based on the most frequent value of another column

Hi everyone,
I’m working on a dataset regarding cancer. In particular i have a column named “Pregnancies” and a column named “Age”. I have several missing values for “Pregnancies” and i would like to replace them with the most frequent value for her “Age”. Can someone please explain me how to do that?
Thank you in advance.

@stefano250396 welcome to the KNIME community.

You would:

  1. Group by Age and Mode of no Pregnancies
  2. Left Join this data back by Age as ID
  3. Use a Rule Engine to replace missing values with this mode value

MISSING $Pregnancies$ => $Pregnancies (Mode)$
TRUE => $Pregnancies$


Thank you very much =D

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.