lenskit.testing.ScorerTests =========================== .. py:class:: lenskit.testing.ScorerTests :canonical: lenskit.testing._components.ScorerTests Bases: :py:obj:`TrainingTests` Common tests for scorer components. Many of these just test that the component runs, not that it produces correct output. .. py:attribute:: component :type: ClassVar[type[lenskit.pipeline.Component]] .. py:attribute:: can_score :type: ClassVar[Literal['some', 'known', 'all']] :value: 'known' What can this scorer score? .. py:attribute:: expected_rmse :type: ClassVar[float | tuple[float, float] | object | None] :value: None Asserts RMSE either less than the provided expected value or between two values as tuple. .. py:attribute:: expected_ndcg :type: ClassVar[float | tuple[float, float] | object | None] :value: None Asserts nDCG either greater than the provided expected value or between two values as tuple. .. py:method:: invoke_scorer(pipe, **kwargs) .. py:method:: verify_models_equivalent(orig, copy) Verify that two models are equivalent. .. py:method:: test_score_known(rng, ml_ds, trained_pipeline) .. py:method:: test_pickle_roundrip(rng, ml_ds, trained_pipeline, trained_model) .. py:method:: test_score_unknown_user(rng, ml_ds, trained_pipeline) score with an unknown user ID .. py:method:: test_score_unknown_item(rng, ml_ds, trained_pipeline) score with one target item unknown .. py:method:: test_score_empty_query(rng, ml_ds, trained_pipeline) score with an empty query .. py:method:: test_score_query_history(rng, ml_ds, trained_pipeline) score when query has user ID and history .. py:method:: test_score_query_history_only(rng, ml_ds, trained_pipeline) score when query only has history .. py:method:: test_score_empty_items(rng, ml_ds, trained_pipeline) score an empty list of items .. py:method:: test_train_score_items_missing_data(rng, ml_ds) train and score when some entities are missing data .. py:method:: test_train_recommend(rng, ml_ds, trained_topn_pipeline) Test that a full train-recommend pipeline works. .. py:method:: test_ray_recommend(rng, ml_ds, trained_topn_pipeline) Ensure pipeline can be used via Ray. .. py:method:: test_run_with_doubles(ml_ratings) .. py:method:: test_batch_prediction_accuracy(rng, ml_100k) .. py:method:: test_batch_top_n_accuracy(rng, ml_100k)