use scikit if available; needs testing and refactoring