Added a block for weighted kNN algorithm, which uses inverse similarity score as weight.