@unittest.skipIf(not ON_REMOTE_NETWORK, "Not in igraph-01 network")
    def test_popularity(self):
        splitter = RandomSplitter()
        training, testing = splitter.split(self.df, 0.20)
        pop = Popularity(normalize=False)
        pop.fit(training)
        self.popularity.fit(training)
        for _, row in testing.iterrows():
            assert row["user"] in training["user"]
            python_score = pop.getScore(row["user"], row["item"])
            okapi_score = self.popularity.getScore(row["user"], row["item"])
            assert okapi_score == python_score, \
                "Okapi popularity(%f) don't give the same score as his python implementation(%f)" % (okapi_score,
                                                                                                     python_score)
Test the popularity okapi algorithm
dataset/ETHPy150Open grafos-ml/test.fm/src/tests/test_okapi.py/TestOkapi.test_popularity