Entfernen Sie zuerst NANS und teilen Sie dann in Zug und Validierung

You should split before pre-processing or imputing.
Real Raccoon