update train_NB method using numpy built-in sum(axis=1) method