Similarity-based k-nearest neighbors algorithms for classification, regression, and clustering