generalizing batch training of classifiers