How to implement k-medoid clustering algorithm for one feature dataset?