0
$\begingroup$

I'm currently working on a dataset with several categorial features, which I need to transform into numerical features through one hot encoding.

However, some of the features have NaN values in them. I understand that, for numerical features, these should be replaced by the feature's mean value to avoid any issues, but I'm unsure of what to do for categorical features.

Will I lose any information if I don't include NaN as a category? What's the typical approach to this situation?

$\endgroup$

1 Answer 1

1
$\begingroup$

For each sample with NaN category, find the most relevant samples with actual value in that feature, based on other features or label similarity, then use the commonly used feature to replace 'NaN' in the sample.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.