FIX inconsistent attributes shapes in naive Bayes

Fixes #2127.