MCPcopy
hub / github.com/benfred/implicit / test_large_recommend

Method test_large_recommend

tests/approximate_als_test.py:136–147  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

134 )
135
136 def test_large_recommend(self):
137 # the GPU version of FAISS can't return more than 1K result (and will assert/exit)
138 # this tests out that we fall back in this case to the exact version and don't die
139 plays = get_checker_board(2048)
140 model = self._get_model()
141 model.fit(plays, show_progress=False)
142
143 recs = model.similar_items(0, N=1050)
144 self.assertEqual(recs[0][0], 0)
145
146 recs = model.recommend(0, plays.T.tocsr()[0], N=1050)
147 self.assertEqual(recs[0][0], 0)
148
149 def test_pickle(self):
150 # pickle isn't supported on faiss indices

Callers

nothing calls this directly

Calls 5

_get_modelMethod · 0.95
get_checker_boardFunction · 0.90
fitMethod · 0.45
similar_itemsMethod · 0.45
recommendMethod · 0.45

Tested by

no test coverage detected