thread-level parallel version for classification problems