create k nearest neighbor