some refactoring - extracted a predict method used by all classifiers