Transfer code from scikit-learn

and setup build and testing