Ensure that the user_based field is taken into account (only) when needed.
(u1_ml100k, pkf)
| 43 | |
| 44 | |
| 45 | def test_user_based_field(u1_ml100k, pkf): |
| 46 | """Ensure that the user_based field is taken into account (only) when |
| 47 | needed.""" |
| 48 | |
| 49 | algorithms = (KNNBasic, KNNWithMeans, KNNBaseline) |
| 50 | for klass in algorithms: |
| 51 | algo = klass(sim_options={"user_based": True}) |
| 52 | rmses_user_based = cross_validate(algo, u1_ml100k, ["rmse"], pkf)["test_rmse"] |
| 53 | algo = klass(sim_options={"user_based": False}) |
| 54 | rmses_item_based = cross_validate(algo, u1_ml100k, ["rmse"], pkf)["test_rmse"] |
| 55 | assert rmses_user_based != rmses_item_based |
| 56 | |
| 57 | |
| 58 | def test_shrinkage_field(u1_ml100k, pkf): |
nothing calls this directly
no test coverage detected