Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 1.32 KB

knn_inspired.rst

File metadata and controls

36 lines (26 loc) · 1.32 KB

k-NN inspired algorithms

These are algorithms that are directly derived from a basic nearest neighbors approach.

Note

For each of these algorithms, the actual number of neighbors that are aggregated to compute an estimation is necessarily less than or equal to k. First, there might just not exist enough neighbors and second, the sets Nik(u) and Nuk(i) only include neighbors for which the similarity measure is positive. It would make no sense to aggregate ratings from users (or items) that are negatively correlated. For a given prediction, the actual number of neighbors can be retrieved in the 'actual_k' field of the details dictionary of the prediction <surprise.prediction_algorithms.predictions.Prediction>.

You may want to read the User Guide <similarity_measures_configuration> on how to configure the sim_options parameter.

surprise.prediction_algorithms.knns.KNNBasic

surprise.prediction_algorithms.knns.KNNWithMeans

surprise.prediction_algorithms.knns.KNNWithZScore

surprise.prediction_algorithms.knns.KNNBaseline