コード例 #1
0
ファイル: test_SvdppModel.py プロジェクト: kiminh/Alpenglow
    def test_ranking(self):
        data = pd.read_csv(
            "python/test_alpenglow/test_data_4",
            sep=' ',
            header=None,
            names=['time', 'user', 'item', 'id', 'score', 'eval'])
        exp = SvdppModel(
            negative_rate=9,
            number_of_iterations=20,
        )
        exp.fit(data)
        preds = exp.recommend(exclude_known=False, k=20)
        if (compiler == "gcc" and stdlib == "libstdc++"):
            #print(preds['item'].tolist())
            assert preds['item'].tolist() ==  \
                [94, 98, 166, 30, 225, 300, 299, 455, 442, 337, 372, 250, 196, 429, 256, 204, 338, 427, 38, 247, 256, 94, 372, 166, 462, 455, 383, 338, 30, 225, 98, 102, 337, 282, 128, 177, 247, 168, 442, 375, 94, 166, 30, 98, 225, 299, 300, 442, 337, 455, 250, 196, 372, 429, 338, 427, 204, 496, 462, 256, 30, 299, 166, 225, 94, 442, 300, 372, 337, 196, 462, 215, 98, 496, 250, 338, 36, 40, 429, 444, 300, 30, 94, 225, 299, 166, 196, 442, 250, 204, 337, 98, 496, 462, 429, 62, 455, 372, 40, 215, 94, 300, 166, 30, 204, 225, 462, 196, 128, 455, 256, 247, 383, 337, 98, 165, 86, 102, 372, 442, 300, 94, 30, 166, 225, 196, 204, 299, 442, 462, 337, 455, 98, 250, 128, 372, 247, 165, 86, 256, 30, 299, 94, 225, 166, 442, 300, 196, 98, 337, 496, 250, 215, 372, 40, 429, 462, 36, 255, 62, 94, 30, 299, 225, 166, 300, 442, 98, 196, 250, 337, 496, 204, 429, 455, 372, 40, 462, 62, 215, 256, 372, 166, 94, 462, 383, 338, 455, 30, 225, 102, 282, 337, 98, 128, 177, 247, 168, 69, 36, 94, 30, 166, 225, 300, 299, 442, 98, 337, 196, 372, 462, 455, 250, 204, 429, 215, 496, 338, 256, 30, 94, 166, 225, 300, 299, 442, 196, 337, 462, 372, 98, 250, 204, 215, 455, 496, 429, 62, 36, 30, 299, 94, 225, 166, 442, 300, 196, 337, 98, 250, 496, 372, 215, 462, 40, 429, 36, 62, 204, 128, 383, 168, 165, 282, 86, 247, 98, 156, 256, 97, 375, 338, 4, 94, 293, 277, 468, 177, 108, 300, 94, 30, 166, 225, 196, 299, 204, 442, 337, 98, 250, 462, 455, 247, 165, 86, 128, 372, 429, 30, 94, 166, 225, 299, 300, 442, 196, 337, 98, 372, 250, 462, 496, 215, 455, 429, 40, 36, 338, 94, 256, 166, 455, 300, 30, 462, 383, 98, 225, 128, 372, 247, 102, 204, 337, 177, 282, 86, 196, 94, 300, 30, 166, 225, 98, 299, 196, 204, 442, 250, 337, 455, 429, 247, 462, 372, 128, 86, 38, 94, 30, 300, 166, 225, 299, 98, 196, 442, 250, 337, 204, 455, 429, 372, 462, 496, 62, 247, 38, 94, 30, 166, 225, 299, 98, 300, 442, 337, 196, 372, 455, 250, 429, 462, 496, 338, 204, 36, 215, 300, 94, 299, 30, 225, 250, 98, 196, 166, 204, 442, 496, 429, 255, 427, 40, 337, 62, 38, 483, 94, 30, 299, 300, 225, 166, 442, 196, 98, 250, 337, 496, 204, 429, 372, 462, 40, 455, 62, 215, 30, 300, 94, 225, 166, 299, 196, 442, 462, 337, 204, 250, 372, 215, 496, 62, 165, 98, 247, 86, 94, 98, 166, 338, 225, 30, 372, 299, 442, 455, 256, 337, 120, 36, 429, 444, 427, 462, 255, 156, 94, 166, 30, 225, 300, 462, 442, 372, 299, 337, 98, 196, 455, 256, 204, 247, 128, 383, 250, 102, 94, 166, 30, 225, 372, 98, 256, 462, 455, 337, 300, 442, 338, 299, 383, 247, 196, 128, 177, 36, 94, 300, 166, 30, 225, 462, 256, 455, 204, 196, 383, 337, 372, 128, 247, 98, 102, 442, 86, 165, 94, 30, 166, 225, 299, 442, 300, 372, 98, 337, 462, 455, 196, 338, 256, 36, 250, 215, 429, 496, 299, 30, 94, 225, 166, 442, 300, 196, 496, 250, 98, 337, 215, 40, 372, 429, 462, 36, 255, 62, 300, 94, 30, 166, 225, 196, 299, 204, 442, 337, 98, 250, 462, 455, 247, 372, 165, 128, 86, 429, 30, 94, 299, 225, 166, 300, 442, 196, 337, 250, 98, 496, 462, 372, 215, 429, 204, 40, 62, 455, 94, 166, 300, 30, 98, 225, 455, 256, 204, 128, 247, 337, 462, 372, 196, 383, 102, 86, 177, 165, 299, 30, 94, 225, 166, 442, 300, 98, 196, 250, 496, 337, 40, 429, 215, 372, 255, 62, 36, 462, 94, 30, 166, 225, 299, 98, 300, 442, 337, 250, 196, 455, 372, 429, 496, 204, 462, 338, 40, 427, 94, 300, 30, 166, 225, 196, 299, 204, 98, 442, 337, 250, 455, 462, 429, 247, 128, 372, 86, 165, 94, 30, 166, 225, 299, 442, 372, 98, 300, 337, 462, 338, 196, 455, 36, 215, 256, 250, 496, 429, 94, 166, 30, 225, 372, 98, 299, 442, 300, 337, 462, 455, 338, 256, 196, 36, 215, 429, 247, 250, 94, 300, 98, 204, 455, 128, 247, 166, 256, 86, 165, 30, 196, 225, 102, 177, 427, 375, 38, 282, 299, 30, 94, 225, 166, 442, 300, 98, 496, 250, 196, 337, 429, 255, 40, 372, 215, 36, 292, 338, 94, 30, 300, 166, 225, 98, 299, 196, 442, 455, 337, 204, 250, 372, 462, 429, 247, 256, 128, 38, 94, 30, 166, 225, 299, 442, 300, 98, 372, 337, 462, 196, 455, 338, 250, 215, 36, 256, 496, 429, 94, 30, 225, 166, 299, 300, 442, 98, 196, 337, 250, 372, 496, 462, 429, 215, 40, 455, 204, 62, 30, 94, 166, 225, 299, 300, 442, 196, 337, 98, 372, 250, 462, 496, 215, 455, 429, 40, 36, 204, 299, 30, 225, 94, 166, 442, 300, 496, 98, 337, 196, 250, 215, 372, 40, 255, 429, 36, 338, 462, 299, 30, 166, 225, 94, 442, 372, 338, 98, 496, 215, 337, 36, 40, 300, 444, 462, 120, 250, 255, 94, 166, 30, 225, 299, 442, 300, 98, 372, 337, 462, 338, 455, 196, 256, 36, 215, 250, 429, 496, 94, 300, 166, 30, 225, 455, 98, 204, 196, 256, 337, 462, 128, 247, 372, 383, 86, 102, 442, 165, 94, 30, 166, 225, 300, 299, 98, 442, 337, 196, 372, 455, 462, 250, 204, 429, 256, 247, 496, 338, 166, 94, 30, 225, 462, 372, 300, 442, 256, 337, 383, 455, 299, 338, 196, 98, 128, 247, 102, 215, 30, 94, 166, 225, 299, 300, 442, 337, 196, 372, 462, 98, 250, 215, 455, 496, 36, 338, 429, 204, 94, 166, 30, 225, 98, 299, 300, 442, 372, 337, 455, 462, 196, 338, 256, 250, 429, 247, 36, 496, 30, 299, 166, 94, 225, 442, 372, 98, 338, 337, 300, 496, 215, 36, 462, 40, 250, 196, 444, 429, 94, 30, 166, 225, 299, 300, 442, 98, 337, 372, 196, 462, 455, 250, 338, 496, 429, 215, 36, 256, 256, 94, 383, 455, 462, 166, 128, 102, 372, 247, 282, 177, 98, 30, 300, 225, 337, 204, 86, 375, 94, 30, 166, 300, 225, 462, 196, 442, 337, 299, 372, 204, 455, 256, 383, 98, 128, 247, 102, 86, 94, 166, 30, 225, 299, 442, 98, 372, 338, 337, 300, 36, 462, 215, 496, 429, 120, 455, 40, 250, 300, 30, 94, 225, 299, 166, 196, 442, 250, 204, 337, 98, 496, 462, 429, 62, 455, 372, 40, 215, 30, 94, 166, 225, 299, 300, 442, 196, 337, 98, 372, 462, 250, 496, 215, 455, 429, 36, 40, 338, 299, 30, 94, 225, 166, 442, 300, 98, 250, 496, 196, 337, 429, 40, 255, 372, 215, 36, 62, 292, 94, 98, 166, 30, 225, 300, 299, 455, 442, 337, 372, 250, 196, 429, 338, 256, 427, 204, 38, 462, 94, 30, 299, 166, 225, 442, 300, 98, 337, 196, 250, 496, 372, 429, 215, 40, 462, 455, 338, 36, 94, 166, 30, 225, 98, 299, 300, 442, 337, 372, 455, 196, 462, 338, 256, 250, 429, 204, 247, 36, 94, 166, 30, 225, 299, 442, 300, 372, 98, 337, 462, 338, 455, 196, 256, 36, 215, 250, 429, 496, 94, 30, 300, 166, 225, 299, 442, 196, 98, 337, 204, 250, 462, 455, 372, 429, 496, 247, 62, 215, 299, 30, 94, 225, 166, 442, 98, 300, 496, 250, 196, 337, 255, 40, 429, 215, 372, 36, 338, 292]

        assert NdcgScore(data, preds,
                         top_k=20) == pytest.approx(0.7361758211688317,
                                                    abs=5 * 1e-3)
        preds2 = exp.recommend(users=[1, 2], exclude_known=False)
        assert preds2['user'].unique().tolist() == [1, 2]

        preds = exp.recommend(exclude_known=True)
        joined_preds = preds.join(data.set_index(['user', 'item']),
                                  on=['user', 'item'],
                                  how='inner',
                                  rsuffix="_right")
        assert len(joined_preds) == 0
コード例 #2
0
    def test_ranking(self):
        data = pd.read_csv(
            "python/test_alpenglow/test_data_4",
            sep=' ',
            header=None,
            names=['time', 'user', 'item', 'id', 'score', 'eval']
        )
        exp = NearestNeighborModel()
        exp.fit(data)
        preds = exp.recommend(exclude_known=False, k=20)

        print("toplist="+str(preds['item'].tolist()))

        if(compiler == "gcc" and stdlib == "libstdc++"):
            assert preds['item'].tolist() ==  \
                [94, 166, 225, 300, 30, 299, 455, 337, 250, 338, 383, 452, 256, 98, 293, 260, 462, 168, 120, 128, 94, 166, 30, 225, 442, 98, 300, 372, 337, 299, 462, 455, 256, 196, 338, 247, 128, 177, 102, 62, 94, 166, 225, 30, 98, 300, 442, 299, 372, 337, 462, 455, 250, 496, 196, 429, 338, 427, 256, 371, 30, 166, 94, 225, 300, 337, 372, 299, 462, 196, 383, 452, 256, 98, 293, 260, 455, 168, 128, 4, 30, 300, 442, 166, 225, 94, 462, 204, 299, 250, 383, 452, 256, 98, 293, 260, 455, 168, 120, 128, 166, 30, 225, 94, 300, 442, 462, 98, 372, 299, 196, 337, 128, 165, 455, 383, 204, 256, 86, 247, 30, 94, 166, 225, 442, 300, 196, 462, 299, 204, 98, 455, 372, 256, 337, 250, 86, 128, 293, 452, 225, 94, 166, 442, 300, 337, 455, 372, 98, 30, 299, 383, 452, 256, 293, 260, 462, 168, 128, 4, 166, 94, 225, 30, 300, 299, 98, 442, 337, 372, 455, 62, 196, 250, 462, 215, 40, 338, 496, 86, 94, 166, 30, 225, 442, 372, 462, 337, 98, 338, 300, 256, 299, 455, 120, 128, 247, 293, 452, 260, 94, 225, 166, 30, 442, 299, 455, 98, 337, 300, 372, 462, 196, 338, 383, 293, 452, 256, 260, 168, 30, 94, 225, 166, 300, 442, 462, 299, 196, 337, 372, 98, 250, 455, 256, 204, 40, 400, 165, 293, 94, 166, 30, 225, 300, 299, 442, 372, 98, 337, 462, 455, 196, 62, 204, 40, 250, 383, 293, 452, 94, 166, 225, 30, 442, 300, 98, 299, 372, 462, 337, 196, 455, 429, 250, 371, 296, 122, 256, 409, 94, 30, 166, 442, 225, 98, 462, 196, 455, 299, 383, 452, 256, 260, 168, 120, 293, 128, 204, 4, 225, 94, 299, 166, 442, 337, 300, 455, 372, 98, 383, 452, 256, 462, 168, 120, 293, 260, 128, 4, 94, 225, 30, 166, 300, 98, 442, 299, 462, 455, 372, 247, 337, 196, 256, 128, 338, 102, 250, 383, 94, 30, 300, 166, 225, 299, 455, 250, 442, 462, 337, 98, 338, 196, 204, 86, 247, 383, 293, 452, 94, 30, 166, 225, 300, 299, 98, 442, 337, 372, 455, 462, 196, 62, 250, 215, 204, 338, 40, 496, 94, 30, 225, 166, 300, 299, 98, 442, 337, 372, 455, 462, 250, 62, 338, 429, 371, 427, 383, 293, 94, 166, 225, 30, 300, 98, 442, 299, 337, 372, 196, 455, 462, 250, 496, 40, 204, 156, 62, 429, 225, 166, 300, 299, 94, 30, 442, 98, 372, 337, 462, 455, 196, 86, 128, 204, 496, 427, 215, 383, 94, 225, 166, 30, 442, 300, 299, 98, 462, 372, 337, 196, 455, 204, 250, 496, 62, 215, 256, 247, 94, 166, 225, 30, 98, 442, 300, 299, 372, 337, 462, 338, 256, 455, 250, 120, 496, 40, 427, 97, 94, 30, 166, 225, 442, 300, 299, 372, 337, 98, 455, 62, 462, 196, 128, 247, 338, 40, 86, 383, 94, 166, 225, 30, 442, 300, 299, 372, 98, 462, 337, 455, 256, 247, 429, 196, 102, 427, 36, 496, 94, 166, 30, 225, 442, 98, 462, 196, 299, 455, 256, 300, 128, 372, 247, 293, 452, 383, 260, 168, 94, 225, 30, 166, 442, 300, 372, 337, 299, 98, 462, 455, 196, 338, 383, 165, 247, 62, 128, 293, 225, 94, 166, 442, 300, 337, 455, 372, 98, 30, 299, 383, 452, 256, 293, 260, 462, 168, 128, 4, 94, 30, 166, 442, 225, 98, 462, 196, 455, 299, 383, 452, 256, 260, 168, 120, 293, 128, 204, 4, 30, 94, 166, 225, 299, 196, 462, 300, 442, 98, 337, 372, 455, 40, 250, 383, 293, 452, 256, 260, 166, 225, 30, 98, 300, 94, 442, 299, 337, 372, 247, 455, 462, 196, 256, 86, 177, 102, 128, 204, 94, 30, 299, 166, 98, 442, 225, 62, 300, 337, 372, 40, 496, 196, 250, 215, 383, 293, 452, 256, 30, 94, 225, 166, 300, 299, 98, 442, 337, 372, 462, 455, 250, 62, 338, 496, 196, 429, 371, 383, 94, 300, 225, 166, 30, 299, 98, 442, 455, 337, 372, 462, 196, 204, 250, 86, 247, 108, 156, 450, 166, 94, 30, 225, 442, 299, 372, 337, 300, 98, 462, 455, 62, 196, 338, 256, 120, 496, 293, 452, 94, 30, 166, 225, 442, 98, 300, 337, 299, 372, 462, 455, 196, 338, 256, 62, 156, 250, 215, 120, 94, 166, 30, 225, 300, 98, 442, 455, 299, 196, 462, 372, 337, 204, 250, 256, 247, 156, 86, 128, 94, 166, 30, 225, 300, 442, 299, 98, 372, 462, 337, 455, 196, 496, 250, 429, 427, 338, 36, 215, 94, 166, 30, 225, 299, 455, 442, 98, 462, 300, 196, 250, 337, 338, 383, 293, 452, 256, 260, 168, 225, 166, 30, 94, 299, 442, 98, 372, 300, 337, 462, 455, 196, 256, 120, 293, 452, 260, 383, 128, 94, 30, 299, 166, 442, 98, 300, 337, 372, 225, 62, 40, 196, 383, 293, 452, 256, 260, 455, 462, 225, 94, 299, 166, 442, 337, 300, 455, 372, 98, 383, 452, 256, 462, 168, 120, 293, 260, 128, 4, 94, 30, 166, 225, 442, 299, 300, 98, 337, 372, 462, 196, 496, 455, 250, 338, 62, 40, 215, 256, 94, 30, 225, 166, 442, 299, 98, 300, 372, 337, 462, 496, 40, 62, 338, 256, 455, 215, 36, 120, 94, 225, 30, 442, 299, 300, 98, 462, 337, 372, 383, 452, 256, 260, 455, 168, 293, 128, 166, 4, 94, 30, 225, 166, 300, 442, 98, 299, 372, 462, 337, 196, 455, 204, 250, 256, 156, 38, 86, 338, 94, 30, 225, 166, 300, 98, 442, 299, 372, 462, 337, 455, 196, 496, 250, 256, 62, 247, 215, 338, 166, 300, 94, 30, 442, 225, 372, 256, 196, 337, 98, 452, 383, 260, 293, 455, 462, 168, 128, 4, 94, 225, 30, 166, 442, 300, 299, 372, 462, 337, 98, 455, 196, 256, 204, 250, 36, 338, 496, 293, 94, 30, 225, 166, 442, 300, 372, 299, 98, 337, 462, 455, 62, 429, 247, 196, 338, 383, 165, 496, 30, 225, 94, 166, 442, 372, 98, 337, 300, 455, 256, 120, 452, 383, 260, 462, 293, 128, 4, 468, 299, 442, 94, 225, 30, 166, 98, 300, 337, 372, 462, 455, 62, 383, 293, 452, 256, 260, 168, 128, 94, 166, 30, 225, 300, 98, 442, 372, 299, 337, 462, 455, 256, 247, 204, 338, 196, 128, 86, 102, 94, 30, 166, 225, 300, 442, 462, 299, 372, 98, 337, 196, 455, 204, 256, 86, 62, 165, 496, 128, 94, 30, 166, 225, 442, 98, 299, 300, 372, 337, 462, 338, 455, 496, 250, 256, 196, 40, 36, 120, 30, 300, 442, 166, 225, 94, 462, 204, 299, 250, 383, 452, 256, 98, 293, 260, 455, 168, 120, 128, 225, 94, 299, 166, 442, 337, 300, 455, 372, 98, 383, 452, 256, 462, 168, 120, 293, 260, 128, 4, 30, 166, 98, 225, 94, 300, 442, 372, 299, 337, 62, 462, 455, 427, 496, 383, 293, 452, 256, 260, 94, 166, 225, 300, 30, 299, 455, 337, 250, 338, 383, 452, 256, 98, 293, 260, 462, 168, 120, 128, 30, 94, 225, 98, 300, 166, 299, 442, 372, 337, 462, 455, 256, 102, 128, 427, 496, 293, 452, 383, 225, 30, 300, 299, 94, 337, 166, 442, 98, 462, 372, 455, 250, 338, 383, 293, 452, 256, 260, 168, 94, 225, 30, 442, 299, 300, 98, 462, 337, 372, 383, 452, 256, 260, 455, 168, 293, 128, 166, 4, 94, 30, 225, 166, 300, 442, 299, 98, 337, 372, 455, 462, 196, 62, 204, 250, 86, 247, 256, 168, 94, 30, 166, 225, 442, 299, 98, 300, 337, 372, 462, 455, 196, 250, 496, 338, 40, 62, 215, 156]

        assert NdcgScore(data, preds, top_k=20) == pytest.approx(0.4987901122546444, abs=1e-2)

        preds2 = exp.recommend(users = [1, 2], exclude_known=False)
        assert preds2['user'].unique().tolist() == [1,2]

        preds = exp.recommend(exclude_known=True)
        joined_preds = preds.join(
            data.set_index(['user', 'item']),
            on=['user','item'], how='inner', rsuffix="_right"
        )
        assert len(joined_preds) == 0
コード例 #3
0
    def test_ranking(self):
        data = pd.read_csv(
            "python/test_alpenglow/test_data_4",
            sep=' ',
            header=None,
            names=['time', 'user', 'item', 'id', 'score', 'eval'])
        exp = PopularityModel()
        exp.fit(data)
        preds = exp.recommend()

        print("toplist=" + str(preds['item'].tolist()))

        if (compiler == "gcc" and stdlib == "libstdc++"):
            assert preds['item'].tolist() ==  \
                [30, 94, 166, 225, 300, 299, 442, 196, 372, 462, 455, 337, 204, 256, 62, 338, 427, 429, 250, 128, 36, 40, 383, 165, 215, 247, 496, 255, 293, 177, 38, 86, 156, 120, 102, 282, 211, 483, 444, 371, 375, 450, 452, 266, 97, 81, 168, 497, 414, 468, 263, 434, 251, 292, 4, 25, 108, 69, 325, 491, 400, 479, 298, 295, 421, 330, 277, 197, 440, 436, 458, 181, 464, 16, 161, 5, 99, 395, 314, 205, 54, 271, 377, 397, 488, 362, 122, 216, 116, 6, 113, 318, 296, 498, 234, 265, 289, 454, 58, 284, 300, 299, 204, 427, 429, 250, 496, 40, 215, 165, 255, 86, 371, 483, 450, 452, 97, 266, 414, 497, 81, 251, 468, 292, 434, 25, 108, 295, 400, 197, 491, 421, 298, 325, 330, 464, 271, 16, 205, 436, 440, 181, 395, 314, 99, 29, 191, 216, 206, 353, 6, 15, 284, 233, 454, 58, 488, 195, 116, 498, 105, 425, 22, 122, 348, 188, 127, 245, 356, 93, 318, 351, 146, 296, 403, 234, 281, 118, 362, 95, 254, 192, 12, 478, 164, 178, 474, 111, 145, 49, 136, 27, 301, 407, 210, 319, 485, 200, 273, 499, 30, 166, 225, 299, 442, 196, 337, 204, 256, 62, 250, 40, 36, 247, 383, 215, 128, 165, 293, 177, 86, 38, 102, 120, 282, 211, 156, 444, 375, 483, 168, 81, 97, 414, 450, 266, 452, 263, 434, 251, 292, 108, 4, 25, 298, 277, 421, 325, 330, 479, 491, 69, 197, 400, 16, 5, 161, 314, 99, 271, 54, 464, 205, 458, 395, 436, 181, 440, 234, 122, 132, 192, 498, 113, 318, 118, 12, 478, 296, 6, 356, 348, 403, 17, 29, 95, 281, 93, 265, 116, 425, 353, 58, 397, 454, 284, 15, 289, 377, 488, 30, 94, 166, 225, 300, 299, 98, 196, 372, 455, 462, 337, 204, 256, 62, 338, 429, 427, 250, 128, 36, 496, 40, 247, 165, 215, 383, 255, 293, 177, 38, 86, 156, 120, 102, 282, 211, 483, 444, 371, 375, 450, 452, 266, 97, 81, 168, 497, 414, 468, 263, 434, 251, 292, 4, 25, 108, 69, 325, 491, 400, 479, 298, 295, 421, 330, 277, 197, 440, 436, 458, 181, 464, 16, 161, 5, 99, 395, 314, 205, 54, 271, 377, 397, 488, 362, 122, 216, 116, 6, 113, 318, 296, 498, 234, 265, 289, 454, 58, 284, 30, 94, 166, 225, 300, 299, 442, 98, 372, 455, 462, 337, 256, 204, 62, 338, 429, 427, 250, 247, 496, 36, 40, 165, 383, 128, 215, 255, 293, 177, 38, 86, 211, 120, 156, 102, 282, 483, 444, 375, 371, 450, 266, 452, 97, 81, 168, 414, 497, 263, 434, 251, 468, 292, 25, 4, 108, 69, 325, 491, 400, 479, 298, 295, 197, 421, 330, 277, 440, 436, 458, 181, 464, 16, 161, 5, 99, 395, 314, 205, 54, 271, 377, 397, 488, 362, 122, 216, 116, 6, 113, 318, 296, 498, 234, 265, 289, 454, 58, 284, 30, 166, 225, 299, 98, 196, 372, 455, 462, 337, 256, 204, 338, 62, 429, 250, 427, 40, 247, 215, 496, 36, 255, 177, 38, 120, 102, 282, 156, 211, 483, 444, 371, 375, 266, 97, 168, 497, 414, 452, 450, 81, 263, 468, 292, 434, 251, 108, 25, 4, 325, 491, 277, 400, 295, 197, 330, 298, 479, 69, 16, 161, 271, 464, 5, 99, 205, 395, 314, 54, 458, 181, 440, 488, 362, 234, 122, 216, 356, 478, 93, 348, 113, 318, 296, 498, 6, 116, 289, 12, 105, 265, 454, 58, 29, 17, 284, 15, 353, 95, 30, 94, 166, 225, 299, 442, 98, 372, 455, 337, 256, 204, 62, 338, 429, 250, 427, 36, 496, 215, 40, 383, 247, 128, 255, 177, 86, 38, 293, 156, 102, 282, 120, 211, 483, 444, 375, 371, 452, 450, 266, 97, 168, 414, 497, 81, 434, 263, 468, 251, 108, 25, 4, 292, 69, 325, 491, 421, 400, 295, 298, 330, 197, 479, 277, 181, 436, 440, 271, 16, 464, 161, 5, 99, 395, 54, 314, 205, 458, 488, 397, 105, 362, 216, 122, 234, 6, 296, 318, 113, 116, 498, 265, 289, 454, 15, 284, 353, 29, 95, 94, 166, 225, 300, 442, 98, 196, 372, 455, 462, 337, 256, 204, 338, 62, 427, 429, 250, 247, 36, 128, 215, 165, 496, 40, 383, 255, 293, 177, 38, 86, 211, 156, 120, 102, 282, 483, 444, 375, 371, 450, 452, 266, 97, 414, 168, 497, 81, 251, 468, 263, 434, 25, 4, 292, 108, 69, 325, 295, 491, 400, 298, 421, 479, 330, 277, 197, 458, 436, 440, 181, 16, 161, 271, 464, 99, 5, 395, 314, 205, 54, 377, 488, 362, 397, 122, 216, 6, 265, 116, 113, 296, 318, 498, 234, 289, 454, 58, 15, 353, 166, 300, 442, 196, 372, 462, 455, 337, 256, 338, 429, 250, 427, 128, 247, 36, 215, 496, 165, 383, 255, 38, 86, 293, 282, 102, 120, 156, 211, 483, 375, 444, 371, 266, 97, 168, 497, 452, 414, 450, 4, 263, 468, 292, 434, 251, 108, 25, 325, 491, 277, 400, 197, 295, 330, 298, 479, 421, 69, 181, 16, 161, 271, 5, 464, 99, 205, 395, 54, 314, 436, 458, 440, 362, 488, 234, 122, 216, 356, 478, 93, 348, 113, 296, 318, 105, 6, 116, 12, 289, 265, 454, 58, 29, 17, 284, 15, 353, 95, 403, 30, 94, 166, 225, 300, 299, 98, 442, 196, 455, 462, 337, 204, 62, 427, 429, 250, 36, 247, 128, 496, 215, 40, 165, 255, 293, 177, 38, 86, 211, 156, 102, 120, 282, 483, 444, 375, 371, 450, 266, 97, 168, 497, 414, 452, 81, 468, 434, 263, 251, 25, 4, 108, 292, 325, 491, 400, 421, 295, 298, 197, 330, 69, 479, 277, 436, 181, 440, 161, 271, 16, 464, 5, 99, 395, 314, 54, 205, 458, 488, 397, 105, 362, 216, 122, 265, 234, 113, 296, 318, 498, 6, 454, 116, 289, 58, 403, 15, 353, 29, 94, 166, 225, 98, 442, 196, 462, 337, 256, 204, 338, 62, 427, 250, 429, 36, 383, 128, 40, 165, 247, 496, 215, 255, 293, 177, 86, 38, 211, 156, 102, 282, 120, 375, 483, 371, 444, 450, 266, 168, 97, 414, 497, 452, 81, 4, 468, 434, 263, 251, 108, 25, 292, 421, 325, 491, 400, 295, 277, 197, 298, 330, 479, 69, 181, 440, 161, 16, 5, 271, 464, 99, 395, 54, 205, 314, 436, 458, 488, 397, 362, 105, 122, 216, 234, 113, 6, 318, 296, 498, 348, 265, 116, 289, 15, 284, 29, 403, 58, 95, 30, 94, 225, 299, 98, 372, 455, 337, 204, 256, 338, 62, 250, 427, 429, 128, 247, 40, 165, 496, 36, 215, 383, 255, 293, 177, 38, 86, 211, 156, 102, 120, 282, 483, 375, 371, 444, 450, 266, 168, 497, 414, 81, 452, 97, 468, 263, 434, 251, 108, 4, 25, 292, 421, 325, 491, 295, 298, 197, 330, 479, 277, 69, 181, 440, 16, 161, 271, 464, 5, 99, 54, 205, 314, 436, 458, 488, 216, 348, 122, 362, 234, 113, 318, 296, 498, 6, 265, 116, 356, 105, 289, 454, 15, 403, 284, 353, 29, 95, 17, 94, 166, 300, 98, 372, 455, 462, 256, 204, 338, 250, 429, 427, 165, 36, 247, 40, 496, 128, 215, 383, 255, 293, 177, 38, 86, 156, 102, 282, 120, 211, 483, 371, 444, 375, 450, 266, 168, 97, 452, 497, 414, 81, 4, 468, 434, 251, 292, 25, 263, 108, 421, 325, 491, 400, 277, 295, 298, 197, 330, 479, 69, 181, 16, 161, 464, 99, 271, 5, 205, 395, 458, 440, 314, 54, 436, 488, 234, 362, 216, 356, 348, 105, 122, 113, 498, 318, 6, 296, 116, 289, 265, 454, 403, 29, 284, 15, 353, 95, 17, 414, 292, 298, 395, 181, 348, 105, 351, 188, 498, 369, 357, 410, 78, 246, 221, 23, 278, 494, 418, 53, 162, 419, 236, 447, 112, 101, 139, 96, 174, 80, 30, 94, 166, 225, 299, 442, 98, 196, 372, 462, 455, 337, 256, 204, 338, 62, 429, 427, 250, 247, 36, 496, 165, 40, 215, 383, 128, 255, 293, 177, 38, 86, 120, 156, 102, 282, 211, 483, 444, 375, 371, 450, 266, 452, 97, 81, 168, 414, 497, 263, 434, 251, 468, 292, 25, 4, 108, 69, 325, 491, 400, 479, 298, 295, 421, 197, 330, 277, 436, 458, 181, 440, 464, 16, 161, 5, 99, 395, 314, 205, 271, 54, 377, 397, 488, 362, 122, 216, 116, 6, 113, 296, 318, 498, 234, 265, 289, 454, 58, 284, 94, 166, 225, 300, 299, 98, 442, 196, 372, 455, 462, 337, 256, 204, 62, 338, 429, 427, 250, 215, 36, 40, 165, 247, 128, 383, 496, 255, 293, 38, 177, 86, 156, 120, 102, 282, 211, 483, 444, 371, 375, 450, 452, 266, 97, 168, 81, 497, 414, 468, 263, 434, 251, 292, 4, 25, 108, 69, 325, 491, 400, 479, 298, 295, 421, 330, 277, 197, 440, 436, 458, 181, 464, 16, 161, 5, 99, 395, 314, 205, 54, 271, 377, 397, 488, 362, 122, 216, 116, 6, 113, 318, 296, 498, 234, 265, 289, 454, 58, 284, 30, 94, 225, 299, 442, 196, 372, 462, 455, 337, 338, 62, 429, 250, 427, 496, 40, 165, 215, 36, 255, 177, 38, 293, 86, 156, 102, 120, 211, 483, 444, 375, 371, 97, 497, 452, 414, 450, 81, 168, 266, 292, 4, 263, 434, 251, 108, 25, 468, 421, 400, 325, 277, 491, 197, 295, 330, 298, 479, 69, 161, 16, 5, 464, 99, 271, 205, 54, 395, 436, 458, 314, 181, 440, 488, 362, 122, 216, 498, 93, 356, 348, 105, 113, 296, 318, 234, 265, 403, 478, 116, 289, 454, 58, 29, 17, 15, 353, 95, 425, 30, 94, 166, 225, 300, 299, 442, 372, 462, 455, 337, 256, 338, 62, 427, 429, 250, 36, 496, 247, 40, 215, 383, 128, 165, 255, 177, 38, 293, 86, 211, 156, 102, 120, 282, 483, 444, 375, 371, 450, 266, 452, 97, 168, 414, 497, 81, 468, 263, 434, 251, 25, 4, 292, 108, 491, 325, 400, 295, 298, 197, 330, 421, 479, 277, 69, 436, 458, 181, 440, 271, 16, 464, 161, 5, 99, 395, 314, 54, 205, 488, 216, 362, 397, 122, 234, 6, 113, 498, 265, 318, 296, 105, 289, 116, 454, 58, 15, 353, 29, 166, 442, 196, 372, 462, 337, 256, 338, 429, 427, 128, 215, 383, 165, 496, 40, 247, 255, 293, 38, 177, 86, 102, 282, 211, 156, 120, 483, 444, 375, 371, 81, 168, 97, 497, 414, 266, 4, 263, 434, 251, 108, 292, 468, 25, 421, 277, 197, 400, 491, 325, 330, 479, 69, 295, 16, 161, 314, 5, 271, 99, 205, 464, 54, 458, 440, 395, 436, 181, 122, 362, 216, 478, 93, 113, 318, 12, 296, 498, 356, 348, 105, 265, 116, 192, 29, 403, 234, 353, 17, 58, 15, 95, 284, 454, 425, 6, 377, 132, 289, 300, 442, 196, 372, 462, 204, 256, 338, 62, 429, 250, 36, 40, 215, 496, 383, 165, 128, 247, 255, 177, 293, 86, 38, 156, 282, 211, 120, 102, 483, 375, 371, 444, 97, 497, 168, 414, 266, 450, 81, 452, 4, 292, 263, 434, 251, 108, 25, 468, 421, 277, 400, 325, 197, 491, 295, 330, 69, 479, 161, 16, 5, 464, 99, 54, 205, 395, 314, 440, 271, 436, 458, 181, 488, 362, 122, 216, 498, 93, 356, 348, 105, 113, 296, 318, 234, 265, 403, 478, 116, 289, 454, 58, 29, 17, 15, 353, 95, 397, 425, 372, 462, 455, 256, 338, 215, 36, 383, 177, 211, 282, 120, 102, 444, 452, 168, 81, 4, 263, 434, 69, 197, 400, 330, 491, 295, 479, 277, 99, 440, 205, 16, 181, 458, 436, 271, 5, 161, 314, 54, 95, 425, 17, 29, 397, 265, 353, 377, 284, 15, 454, 351, 289, 58, 488, 116, 6, 188, 127, 206, 105, 348, 356, 498, 77, 195, 362, 122, 254, 146, 281, 132, 113, 318, 296, 234, 12, 403, 233, 192, 478, 93, 484, 1, 45, 290, 493, 164, 178, 111, 145, 301, 474, 49, 361, 136, 27, 200, 273, 210, 166, 225, 300, 299, 442, 98, 196, 372, 455, 462, 337, 204, 256, 62, 338, 429, 250, 427, 36, 215, 247, 383, 40, 496, 128, 177, 293, 38, 86, 156, 102, 120, 282, 211, 483, 444, 375, 371, 452, 450, 266, 97, 168, 414, 497, 434, 263, 468, 251, 108, 25, 4, 292, 69, 325, 491, 421, 400, 277, 295, 197, 330, 298, 479, 181, 436, 440, 271, 16, 464, 161, 5, 99, 395, 54, 314, 205, 458, 488, 397, 105, 362, 216, 122, 234, 6, 296, 318, 113, 116, 498, 265, 289, 454, 15, 284, 353, 403, 95, 17, 98, 455, 256, 338, 427, 429, 255, 38, 177, 293, 120, 282, 156, 211, 444, 375, 483, 371, 266, 168, 97, 414, 450, 292, 108, 25, 468, 4, 197, 325, 277, 330, 295, 298, 69, 479, 491, 421, 54, 99, 458, 205, 436, 181, 314, 161, 464, 16, 440, 271, 5, 425, 191, 22, 127, 206, 403, 95, 254, 6, 29, 245, 77, 351, 17, 397, 118, 353, 233, 377, 132, 192, 58, 284, 146, 289, 454, 15, 281, 265, 116, 105, 488, 216, 478, 93, 362, 122, 356, 348, 234, 12, 113, 296, 318, 420, 270, 380, 1, 493, 30, 225, 300, 299, 442, 196, 372, 462, 455, 337, 204, 62, 429, 250, 383, 165, 215, 36, 128, 496, 247, 38, 177, 86, 293, 102, 156, 444, 483, 371, 375, 81, 497, 168, 452, 450, 266, 4, 263, 468, 434, 251, 292, 108, 25, 298, 277, 421, 479, 491, 197, 295, 69, 400, 16, 161, 5, 99, 464, 54, 205, 458, 395, 436, 271, 181, 440, 216, 118, 132, 362, 234, 113, 281, 192, 296, 318, 498, 93, 6, 478, 356, 348, 265, 29, 12, 105, 116, 403, 353, 17, 454, 284, 95, 58, 289, 425, 146, 377, 488, 30, 94, 166, 300, 442, 98, 196, 455, 462, 337, 256, 204, 338, 429, 250, 427, 36, 247, 496, 40, 215, 255, 177, 293, 86, 38, 102, 282, 156, 120, 211, 483, 444, 375, 371, 450, 266, 97, 168, 497, 414, 81, 452, 4, 468, 263, 434, 251, 292, 25, 108, 421, 325, 491, 400, 277, 295, 298, 197, 330, 479, 69, 181, 440, 16, 161, 464, 99, 271, 5, 205, 395, 458, 314, 54, 436, 488, 234, 362, 216, 356, 348, 105, 122, 113, 318, 6, 296, 498, 116, 289, 265, 454, 403, 29, 284, 15, 353, 95, 17, 300, 98, 196, 337, 204, 338, 62, 250, 40, 496, 165, 128, 255, 38, 293, 211, 156, 120, 375, 444, 452, 450, 168, 497, 97, 81, 266, 468, 434, 108, 25, 4, 263, 292, 277, 197, 298, 479, 491, 400, 421, 295, 325, 99, 395, 314, 54, 436, 464, 458, 440, 161, 181, 16, 271, 5, 318, 113, 245, 206, 254, 77, 296, 351, 403, 127, 22, 17, 195, 146, 95, 132, 192, 118, 425, 353, 29, 397, 377, 15, 191, 281, 58, 289, 284, 478, 12, 265, 116, 93, 356, 105, 488, 362, 216, 188, 234, 498, 6, 122, 30, 94, 166, 225, 299, 98, 442, 196, 372, 455, 462, 337, 204, 256, 338, 62, 427, 429, 250, 247, 36, 215, 165, 496, 40, 128, 255, 293, 177, 38, 86, 211, 156, 120, 102, 282, 483, 444, 371, 375, 450, 452, 266, 97, 414, 168, 497, 81, 251, 468, 263, 434, 4, 25, 292, 108, 69, 325, 295, 491, 400, 298, 421, 479, 330, 277, 197, 458, 436, 440, 181, 16, 161, 271, 464, 99, 5, 395, 314, 205, 54, 377, 488, 362, 397, 122, 216, 6, 265, 116, 113, 296, 318, 498, 234, 289, 454, 58, 15, 353, 94, 225, 300, 98, 196, 462, 204, 256, 62, 338, 427, 429, 250, 165, 383, 36, 215, 496, 40, 247, 255, 177, 86, 38, 102, 282, 120, 211, 156, 371, 444, 375, 483, 497, 452, 168, 97, 414, 266, 81, 450, 263, 292, 468, 434, 251, 108, 25, 277, 421, 325, 197, 491, 400, 298, 295, 69, 330, 479, 16, 5, 271, 464, 99, 54, 205, 395, 161, 440, 458, 436, 314, 181, 488, 93, 362, 122, 498, 216, 478, 356, 348, 113, 296, 318, 425, 265, 403, 12, 105, 116, 289, 454, 29, 95, 15, 397, 284, 353, 17, 94, 166, 225, 300, 442, 98, 196, 372, 455, 462, 337, 256, 204, 338, 62, 427, 429, 250, 247, 36, 128, 215, 165, 496, 40, 383, 255, 293, 177, 38, 86, 211, 156, 120, 102, 282, 483, 444, 375, 371, 450, 452, 266, 97, 414, 168, 497, 81, 251, 468, 263, 434, 25, 4, 292, 108, 69, 325, 295, 491, 400, 298, 421, 479, 330, 277, 197, 458, 436, 440, 181, 16, 161, 271, 464, 99, 5, 395, 314, 205, 54, 377, 488, 362, 397, 122, 216, 6, 265, 116, 113, 296, 318, 498, 234, 289, 454, 58, 15, 353, 30, 94, 166, 225, 299, 442, 98, 196, 372, 462, 455, 337, 256, 204, 338, 62, 429, 427, 250, 247, 36, 496, 165, 40, 215, 383, 128, 255, 293, 177, 38, 86, 120, 156, 102, 282, 211, 483, 444, 375, 371, 450, 266, 452, 97, 81, 168, 414, 497, 263, 434, 251, 468, 292, 25, 4, 108, 69, 325, 491, 400, 479, 298, 295, 421, 197, 330, 277, 436, 458, 181, 440, 464, 16, 161, 5, 99, 395, 314, 205, 271, 54, 377, 397, 488, 362, 122, 216, 116, 6, 113, 296, 318, 498, 234, 265, 289, 454, 58, 284, 30, 94, 166, 225, 299, 98, 196, 372, 462, 455, 337, 204, 256, 62, 338, 427, 429, 250, 36, 215, 40, 247, 128, 383, 165, 255, 177, 293, 38, 86, 211, 156, 102, 120, 282, 444, 371, 483, 375, 450, 452, 266, 97, 414, 168, 497, 81, 251, 263, 468, 434, 25, 4, 292, 108, 69, 325, 491, 400, 295, 298, 330, 421, 479, 277, 197, 436, 458, 181, 440, 271, 16, 464, 161, 5, 99, 395, 314, 54, 205, 488, 216, 362, 397, 122, 234, 6, 113, 265, 318, 296, 498, 105, 289, 116, 454, 58, 15, 353, 29, 30, 166, 225, 300, 299, 98, 442, 196, 372, 462, 455, 337, 256, 62, 338, 250, 429, 427, 36, 247, 496, 128, 40, 215, 383, 165, 255, 177, 38, 293, 86, 211, 156, 102, 120, 483, 444, 375, 371, 452, 450, 266, 97, 168, 414, 497, 81, 263, 434, 468, 251, 25, 4, 292, 108, 69, 491, 325, 400, 295, 298, 197, 330, 421, 479, 277, 436, 458, 181, 440, 271, 16, 464, 161, 5, 99, 395, 314, 54, 205, 488, 216, 362, 397, 122, 234, 6, 113, 498, 265, 318, 296, 105, 289, 116, 454, 58, 15, 353, 29, 30, 94, 166, 300, 299, 98, 442, 196, 372, 455, 462, 337, 256, 204, 338, 427, 429, 250, 36, 247, 496, 215, 165, 128, 383, 255, 293, 38, 177, 86, 156, 120, 211, 102, 282, 483, 444, 375, 371, 450, 452, 266, 97, 168, 81, 497, 414, 468, 263, 434, 251, 25, 4, 292, 108, 69, 325, 491, 400, 298, 295, 479, 421, 330, 277, 197, 440, 436, 458, 181, 271, 464, 16, 161, 205, 99, 5, 395, 314, 54, 377, 397, 488, 362, 122, 216, 116, 6, 113, 296, 318, 498, 234, 454, 105, 265, 289, 58, 284, 15, 30, 300, 299, 442, 196, 372, 462, 455, 337, 204, 256, 338, 62, 429, 165, 215, 36, 496, 128, 247, 40, 383, 255, 293, 177, 86, 38, 156, 102, 282, 120, 211, 375, 483, 444, 371, 450, 266, 497, 97, 168, 81, 414, 452, 468, 263, 434, 251, 4, 25, 108, 292, 421, 325, 491, 400, 298, 277, 197, 330, 479, 295, 69, 181, 16, 161, 464, 5, 271, 99, 395, 314, 54, 205, 458, 440, 436, 488, 216, 362, 348, 105, 122, 498, 6, 113, 296, 318, 116, 289, 356, 234, 265, 454, 58, 29, 403, 425, 284, 15, 94, 166, 225, 300, 299, 442, 98, 372, 462, 337, 256, 338, 62, 427, 429, 250, 36, 165, 40, 247, 496, 128, 215, 383, 255, 293, 177, 86, 38, 211, 156, 102, 282, 120, 483, 375, 371, 444, 450, 168, 97, 452, 497, 414, 81, 468, 4, 434, 251, 108, 25, 263, 292, 421, 325, 491, 400, 295, 277, 197, 298, 330, 479, 69, 181, 440, 16, 161, 464, 271, 5, 99, 395, 54, 205, 314, 436, 458, 488, 216, 105, 122, 362, 498, 234, 113, 296, 318, 116, 6, 348, 265, 289, 454, 15, 403, 284, 353, 29, 95, 166, 300, 299, 98, 196, 462, 455, 256, 204, 62, 250, 427, 247, 496, 383, 128, 40, 215, 165, 36, 255, 38, 293, 86, 177, 156, 120, 102, 211, 282, 483, 444, 371, 375, 168, 97, 414, 452, 497, 450, 81, 266, 4, 263, 292, 434, 251, 108, 25, 468, 421, 400, 325, 277, 491, 197, 295, 298, 330, 69, 479, 16, 161, 271, 5, 464, 99, 205, 395, 314, 54, 458, 436, 181, 440, 488, 216, 356, 362, 234, 348, 122, 498, 105, 296, 318, 113, 265, 6, 289, 93, 403, 116, 454, 58, 29, 95, 284, 15, 353, 196, 204, 62, 427, 429, 250, 496, 165, 128, 40, 383, 215, 247, 255, 86, 293, 177, 282, 102, 444, 483, 375, 371, 497, 97, 81, 168, 450, 414, 266, 452, 25, 4, 434, 251, 108, 292, 468, 263, 197, 277, 479, 400, 295, 69, 325, 330, 491, 314, 5, 99, 205, 161, 54, 271, 464, 436, 181, 458, 395, 440, 16, 122, 425, 113, 498, 146, 281, 318, 132, 296, 6, 195, 118, 192, 12, 403, 397, 93, 356, 17, 29, 105, 351, 478, 348, 353, 95, 377, 289, 15, 265, 116, 58, 284, 488, 216, 234, 454, 362, 30, 166, 225, 299, 442, 372, 462, 337, 338, 40, 215, 496, 36, 383, 255, 120, 211, 444, 483, 168, 97, 81, 497, 414, 452, 4, 251, 263, 25, 292, 434, 277, 479, 197, 298, 69, 400, 330, 421, 491, 295, 325, 5, 54, 99, 314, 395, 205, 458, 436, 440, 181, 161, 464, 271, 296, 234, 254, 206, 233, 77, 245, 195, 146, 351, 29, 403, 281, 95, 425, 127, 132, 353, 17, 192, 15, 58, 397, 118, 12, 289, 454, 377, 93, 478, 265, 116, 22, 356, 348, 105, 488, 362, 216, 122, 6, 191, 113, 498, 318, 337, 256, 204, 338, 62, 40, 383, 128, 165, 86, 120, 102, 156, 282, 375, 450, 168, 452, 497, 97, 266, 468, 108, 4, 263, 434, 325, 298, 69, 277, 197, 479, 421, 440, 99, 54, 436, 464, 161, 16, 314, 395, 205, 5, 458, 403, 188, 29, 17, 95, 191, 22, 127, 254, 353, 425, 77, 284, 377, 454, 58, 397, 206, 195, 265, 116, 488, 216, 132, 192, 356, 118, 122, 362, 289, 234, 6, 233, 498, 15, 245, 478, 93, 113, 281, 12, 296, 318, 270, 493, 420, 380, 484, 1, 331, 45, 290, 111, 164, 178, 30, 94, 166, 225, 299, 442, 196, 372, 455, 462, 337, 256, 204, 338, 62, 429, 427, 250, 383, 247, 36, 215, 165, 496, 40, 128, 255, 293, 177, 38, 86, 211, 156, 120, 102, 282, 483, 444, 371, 375, 450, 452, 266, 97, 414, 168, 497, 81, 251, 468, 263, 434, 4, 25, 292, 108, 69, 325, 295, 491, 400, 298, 421, 479, 330, 277, 197, 458, 436, 440, 181, 16, 161, 271, 464, 99, 5, 395, 314, 205, 54, 377, 488, 362, 397, 122, 216, 6, 265, 116, 113, 296, 318, 498, 234, 289, 454, 58, 15, 353, 166, 225, 299, 98, 196, 372, 462, 455, 256, 204, 62, 250, 427, 429, 247, 36, 40, 165, 128, 215, 383, 496, 255, 293, 177, 86, 38, 156, 282, 102, 211, 120, 483, 444, 375, 371, 450, 266, 97, 81, 497, 414, 168, 452, 468, 263, 434, 251, 4, 25, 108, 292, 421, 325, 491, 400, 298, 295, 277, 197, 330, 479, 69, 181, 440, 16, 161, 464, 5, 271, 99, 395, 314, 54, 458, 205, 436, 488, 216, 362, 348, 105, 122, 6, 113, 296, 318, 498, 116, 289, 356, 234, 265, 454, 58, 29, 403, 284, 15, 353, 30, 94, 166, 300, 299, 442, 98, 196, 372, 462, 455, 337, 256, 204, 338, 427, 250, 429, 247, 215, 36, 40, 496, 128, 165, 383, 255, 293, 177, 38, 86, 156, 120, 102, 282, 211, 483, 444, 375, 371, 450, 452, 266, 97, 168, 81, 497, 414, 251, 468, 263, 434, 25, 4, 292, 108, 69, 325, 491, 400, 298, 295, 479, 421, 330, 277, 197, 440, 436, 458, 181, 464, 16, 161, 205, 271, 99, 5, 395, 314, 54, 377, 397, 488, 362, 122, 216, 116, 6, 113, 296, 318, 498, 234, 454, 265, 289, 58, 284, 15, 94, 166, 225, 300, 299, 98, 442, 196, 372, 455, 462, 337, 256, 204, 62, 338, 429, 427, 250, 215, 36, 40, 165, 247, 128, 383, 496, 255, 293, 38, 177, 86, 156, 120, 102, 282, 211, 483, 444, 371, 375, 450, 452, 266, 97, 168, 81, 497, 414, 468, 263, 434, 251, 292, 4, 25, 108, 69, 325, 491, 400, 479, 298, 295, 421, 330, 277, 197, 440, 436, 458, 181, 464, 16, 161, 5, 99, 395, 314, 205, 54, 271, 377, 397, 488, 362, 122, 216, 116, 6, 113, 318, 296, 498, 234, 265, 289, 454, 58, 284, 455, 204, 256, 427, 247, 128, 165, 36, 383, 177, 38, 86, 156, 282, 102, 375, 371, 483, 168, 450, 414, 97, 266, 81, 497, 452, 108, 251, 468, 4, 421, 277, 197, 295, 330, 298, 400, 69, 479, 325, 54, 205, 5, 395, 314, 458, 161, 16, 436, 464, 440, 296, 191, 318, 6, 22, 245, 233, 77, 403, 17, 254, 29, 95, 127, 188, 118, 281, 132, 192, 353, 425, 351, 397, 15, 377, 58, 195, 289, 454, 284, 146, 12, 265, 116, 356, 348, 105, 93, 362, 488, 122, 234, 478, 216, 498, 113, 409, 270, 493, 300, 98, 196, 372, 455, 462, 337, 204, 250, 429, 427, 128, 383, 165, 247, 255, 177, 38, 86, 293, 282, 102, 156, 211, 375, 371, 483, 81, 452, 497, 450, 266, 263, 4, 251, 25, 108, 468, 197, 298, 277, 479, 325, 295, 421, 330, 69, 491, 400, 16, 5, 395, 99, 464, 54, 271, 458, 436, 181, 440, 161, 362, 216, 195, 146, 122, 351, 113, 498, 296, 318, 234, 281, 118, 132, 12, 478, 425, 93, 356, 348, 403, 29, 77, 192, 105, 17, 95, 6, 284, 15, 116, 58, 397, 289, 377, 254, 265, 454, 488, 30, 94, 225, 300, 299, 98, 442, 196, 372, 455, 462, 337, 204, 256, 62, 338, 429, 427, 250, 215, 36, 40, 165, 247, 128, 383, 496, 255, 293, 38, 177, 86, 156, 120, 102, 282, 211, 483, 444, 371, 375, 450, 452, 266, 97, 168, 81, 497, 414, 468, 263, 434, 251, 292, 4, 25, 108, 69, 325, 491, 400, 479, 298, 295, 421, 330, 277, 197, 440, 436, 458, 181, 464, 16, 161, 5, 99, 395, 314, 205, 54, 271, 377, 397, 488, 362, 122, 216, 116, 6, 113, 318, 296, 498, 234, 265, 289, 454, 58, 284, 299, 98, 62, 338, 429, 383, 40, 496, 247, 36, 215, 128, 255, 293, 120, 282, 444, 371, 81, 497, 452, 414, 97, 468, 251, 292, 263, 25, 434, 330, 491, 400, 325, 479, 295, 421, 277, 298, 69, 395, 205, 458, 16, 54, 161, 271, 181, 5, 464, 314, 99, 397, 29, 17, 281, 191, 353, 216, 377, 22, 206, 15, 454, 284, 254, 116, 488, 265, 188, 362, 245, 77, 351, 105, 127, 118, 348, 289, 498, 132, 122, 233, 146, 192, 113, 12, 478, 195, 93, 425, 45, 290, 111, 164, 178, 484, 474, 145, 27, 136, 442, 196, 372, 62, 338, 427, 165, 383, 128, 255, 86, 177, 293, 282, 156, 120, 211, 371, 375, 444, 414, 168, 97, 81, 266, 450, 434, 251, 25, 108, 292, 468, 4, 263, 277, 69, 330, 295, 197, 479, 421, 298, 325, 400, 491, 5, 395, 99, 205, 54, 314, 458, 440, 271, 161, 464, 16, 436, 181, 113, 318, 6, 351, 195, 296, 425, 281, 403, 118, 132, 77, 146, 192, 17, 12, 29, 397, 478, 95, 93, 348, 353, 254, 377, 356, 105, 15, 454, 58, 265, 116, 284, 488, 216, 289, 233, 362, 234, 122, 498, 30, 94, 166, 225, 300, 299, 98, 442, 196, 372, 455, 337, 204, 256, 62, 338, 429, 427, 250, 215, 36, 40, 165, 247, 128, 383, 496, 255, 293, 38, 177, 86, 156, 120, 102, 282, 211, 483, 444, 371, 375, 450, 452, 266, 97, 168, 81, 497, 414, 468, 263, 434, 251, 292, 4, 25, 108, 69, 325, 491, 400, 479, 298, 295, 421, 330, 277, 197, 440, 436, 458, 181, 464, 16, 161, 5, 99, 395, 314, 205, 54, 271, 377, 397, 488, 362, 122, 216, 116, 6, 113, 318, 296, 498, 234, 265, 289, 454, 58, 284, 94, 225, 98, 372, 455, 337, 204, 338, 62, 427, 250, 429, 496, 165, 36, 247, 40, 383, 128, 255, 177, 38, 293, 86, 156, 102, 282, 120, 211, 444, 371, 375, 483, 97, 497, 452, 414, 168, 450, 81, 266, 292, 4, 263, 434, 251, 108, 25, 468, 421, 400, 325, 277, 491, 197, 295, 298, 330, 479, 69, 16, 161, 5, 464, 99, 271, 205, 395, 314, 54, 436, 458, 181, 440, 488, 216, 362, 122, 234, 93, 356, 348, 105, 113, 296, 318, 498, 265, 6, 478, 403, 116, 289, 454, 58, 29, 95, 284, 15, 353, 30, 300, 299, 98, 196, 462, 455, 337, 256, 204, 62, 338, 250, 496, 40, 165, 215, 383, 247, 36, 255, 177, 86, 293, 38, 156, 102, 282, 120, 211, 483, 444, 375, 97, 497, 452, 414, 168, 266, 81, 450, 4, 292, 263, 434, 251, 108, 25, 468, 421, 277, 400, 325, 197, 491, 295, 298, 330, 69, 479, 16, 161, 5, 464, 99, 54, 271, 205, 395, 314, 440, 436, 458, 181, 488, 216, 362, 498, 122, 234, 93, 356, 348, 105, 113, 296, 318, 6, 265, 403, 478, 116, 289, 454, 58, 29, 17, 15, 353, 95, 30, 94, 166, 225, 300, 442, 98, 196, 372, 455, 462, 337, 256, 204, 62, 429, 250, 427, 36, 128, 247, 40, 215, 383, 165, 496, 255, 293, 177, 38, 86, 211, 156, 102, 120, 282, 444, 483, 375, 371, 450, 266, 452, 97, 414, 168, 81, 497, 468, 263, 434, 251, 25, 292, 4, 108, 69, 325, 491, 295, 400, 298, 421, 197, 479, 330, 277, 436, 458, 181, 440, 16, 161, 271, 464, 99, 5, 395, 314, 205, 54, 377, 488, 362, 397, 122, 216, 6, 265, 116, 113, 296, 318, 234, 289, 498, 454, 58, 15, 353, 300, 299, 442, 98, 196, 372, 462, 455, 337, 204, 256, 338, 62, 427, 250, 429, 247, 40, 128, 215, 165, 383, 36, 496, 255, 293, 177, 38, 86, 211, 120, 156, 102, 282, 444, 375, 371, 483, 266, 450, 168, 97, 497, 81, 414, 452, 468, 4, 263, 434, 251, 108, 25, 292, 325, 491, 400, 421, 298, 197, 295, 330, 69, 479, 277, 181, 436, 440, 161, 271, 16, 464, 5, 99, 395, 314, 54, 205, 458, 488, 216, 105, 362, 122, 265, 6, 113, 296, 318, 498, 289, 58, 234, 116, 454, 284, 403, 425, 15, 353, 299, 442, 196, 62, 427, 429, 250, 496, 36, 215, 40, 255, 38, 293, 156, 120, 211, 483, 444, 371, 414, 450, 97, 81, 266, 108, 263, 251, 25, 4, 434, 292, 295, 421, 325, 298, 400, 491, 330, 99, 205, 395, 271, 181, 314, 436, 440, 464, 216, 188, 191, 377, 206, 245, 22, 233, 254, 353, 15, 284, 425, 58, 289, 488, 498, 195, 265, 77, 351, 146, 362, 127, 105, 192, 348, 132, 397, 122, 118, 6, 113, 454, 296, 318, 17, 403, 234, 93, 95, 281, 12, 478, 356, 484, 1, 290, 45, 145, 49, 474, 299, 98, 372, 455, 337, 62, 338, 427, 250, 247, 40, 36, 128, 496, 255, 38, 293, 177, 102, 282, 120, 156, 371, 444, 483, 375, 97, 497, 168, 450, 266, 414, 25, 251, 434, 468, 292, 4, 108, 277, 197, 298, 421, 69, 479, 325, 295, 400, 330, 491, 5, 314, 99, 54, 464, 205, 458, 271, 161, 436, 181, 16, 395, 440, 281, 122, 498, 113, 118, 318, 192, 296, 146, 132, 12, 478, 93, 403, 105, 17, 348, 29, 95, 195, 356, 265, 353, 425, 397, 15, 6, 377, 116, 289, 58, 284, 234, 351, 454, 362, 300, 196, 455, 204, 62, 427, 383, 128, 165, 247, 255, 177, 38, 293, 86, 102, 211, 282, 371, 497, 81, 452, 266, 450, 4, 434, 251, 292, 108, 25, 263, 468, 400, 277, 197, 69, 330, 491, 298, 421, 205, 99, 54, 395, 436, 161, 16, 314, 458, 181, 5, 271, 318, 113, 425, 403, 188, 6, 17, 22, 127, 296, 95, 265, 191, 206, 245, 233, 351, 29, 397, 77, 195, 353, 377, 284, 15, 454, 254, 118, 289, 58, 146, 116, 488, 132, 478, 348, 105, 216, 362, 356, 498, 234, 122, 270, 380, 409, 1, 493, 30, 94, 166, 225, 300, 299, 442, 98, 372, 455, 462, 337, 256, 204, 62, 338, 429, 427, 250, 247, 496, 36, 40, 165, 383, 128, 215, 255, 293, 177, 38, 86, 211, 120, 156, 102, 282, 483, 444, 375, 371, 450, 266, 452, 97, 81, 168, 414, 497, 263, 434, 251, 468, 292, 25, 4, 108, 69, 325, 491, 400, 479, 298, 295, 197, 421, 330, 277, 440, 436, 458, 181, 464, 16, 161, 5, 99, 395, 314, 205, 54, 271, 377, 397, 488, 362, 122, 216, 116, 6, 113, 318, 296, 498, 234, 265, 289, 454, 58, 284, 94, 166, 225, 300, 299, 98, 442, 196, 372, 455, 462, 337, 256, 204, 62, 338, 429, 427, 250, 215, 36, 40, 165, 247, 128, 383, 496, 255, 293, 38, 177, 86, 156, 120, 102, 282, 211, 483, 444, 371, 375, 450, 452, 266, 97, 168, 81, 497, 414, 468, 263, 434, 251, 292, 4, 25, 108, 69, 325, 491, 400, 479, 298, 295, 421, 330, 277, 197, 440, 436, 458, 181, 464, 16, 161, 5, 99, 395, 314, 205, 54, 271, 377, 397, 488, 362, 122, 216, 116, 6, 113, 318, 296, 498, 234, 265, 289, 454, 58, 284, 30, 166, 300, 98, 442, 196, 372, 462, 455, 337, 256, 204, 338, 62, 429, 250, 427, 165, 36, 496, 215, 40, 383, 247, 128, 177, 293, 86, 38, 156, 102, 282, 120, 211, 483, 444, 375, 371, 452, 450, 266, 97, 168, 414, 497, 81, 434, 263, 468, 251, 25, 108, 4, 292, 69, 325, 491, 421, 400, 295, 277, 197, 298, 330, 479, 181, 436, 440, 271, 16, 464, 161, 5, 99, 395, 54, 205, 314, 458, 488, 397, 105, 362, 216, 122, 234, 6, 296, 318, 113, 116, 498, 265, 289, 454, 15, 284, 353, 403, 95, 30, 94, 166, 225, 300, 299, 442, 196, 372, 462, 455, 337, 204, 256, 62, 338, 427, 429, 250, 128, 36, 40, 383, 165, 215, 247, 496, 255, 293, 177, 38, 86, 156, 120, 102, 282, 211, 483, 444, 371, 375, 450, 452, 266, 97, 81, 168, 497, 414, 468, 263, 434, 251, 292, 4, 25, 108, 69, 325, 491, 400, 479, 298, 295, 421, 330, 277, 197, 440, 436, 458, 181, 464, 16, 161, 5, 99, 395, 314, 205, 54, 271, 377, 397, 488, 362, 122, 216, 116, 6, 113, 318, 296, 498, 234, 265, 289, 454, 58, 284, 30, 94, 225, 300, 98, 442, 196, 372, 462, 455, 337, 256, 204, 62, 338, 429, 250, 427, 36, 496, 215, 40, 383, 165, 128, 177, 293, 86, 38, 211, 156, 102, 120, 282, 483, 375, 444, 371, 450, 452, 266, 97, 168, 414, 497, 81, 434, 263, 468, 251, 25, 108, 4, 292, 69, 325, 491, 421, 400, 295, 277, 298, 330, 197, 479, 181, 436, 440, 271, 16, 464, 161, 5, 99, 395, 54, 205, 314, 458, 488, 397, 105, 362, 216, 122, 234, 6, 296, 318, 113, 116, 498, 265, 289, 454, 15, 284, 353, 403, 95, 30, 225, 300, 299, 442, 196, 372, 455, 462, 337, 256, 204, 338, 62, 429, 427, 250, 36, 496, 128, 383, 247, 40, 215, 165, 255, 177, 38, 293, 86, 211, 156, 102, 120, 282, 483, 444, 375, 371, 450, 266, 452, 97, 168, 414, 497, 81, 468, 263, 434, 251, 4, 25, 292, 108, 491, 325, 400, 295, 298, 197, 330, 421, 479, 277, 69, 436, 458, 181, 440, 271, 16, 464, 161, 5, 99, 395, 314, 54, 205, 488, 216, 362, 397, 122, 234, 6, 113, 498, 265, 318, 296, 105, 289, 116, 454, 58, 15, 353, 29, 30, 94, 225, 300, 299, 98, 442, 196, 372, 455, 462, 337, 204, 256, 62, 338, 429, 427, 250, 215, 36, 40, 165, 247, 128, 383, 496, 255, 293, 38, 177, 86, 156, 120, 102, 282, 211, 483, 444, 371, 375, 450, 452, 266, 97, 168, 81, 497, 414, 468, 263, 434, 251, 292, 4, 25, 108, 69, 325, 491, 400, 479, 298, 295, 421, 330, 277, 197, 440, 436, 458, 181, 464, 16, 161, 5, 99, 395, 314, 205, 54, 271, 377, 397, 488, 362, 122, 216, 116, 6, 113, 318, 296, 498, 234, 265, 289, 454, 58, 284, 94, 442, 98, 372, 462, 337, 256, 338, 62, 427, 250, 429, 36, 215, 496, 383, 247, 128, 40, 165, 255, 293, 86, 38, 177, 156, 102, 282, 120, 211, 483, 444, 371, 375, 168, 97, 497, 414, 452, 450, 81, 266, 292, 4, 263, 434, 251, 108, 25, 468, 421, 400, 325, 277, 491, 69, 295, 298, 330, 479, 16, 161, 5, 464, 99, 271, 205, 395, 314, 440, 54, 436, 458, 181, 488, 216, 362, 122, 234, 498, 93, 356, 348, 105, 113, 296, 318, 265, 6, 478, 403, 116, 289, 454, 58, 29, 95, 284, 15, 353, 462, 204, 256, 429, 128, 383, 247, 165, 86, 102, 211, 282, 371, 375, 483, 414, 168, 452, 497, 81, 251, 468, 263, 295, 479, 197, 330, 421, 69, 298, 325, 400, 161, 54, 464, 271, 205, 436, 16, 395, 440, 5, 458, 314, 403, 397, 22, 29, 17, 146, 353, 95, 188, 191, 6, 15, 284, 216, 58, 206, 289, 377, 116, 233, 265, 245, 254, 105, 488, 281, 348, 195, 118, 362, 122, 132, 192, 318, 113, 454, 296, 498, 77, 12, 234, 93, 356, 290, 484, 1, 178, 45, 493, 111, 474, 164, 27, 301, 49, 361]

        assert NdcgScore(data, preds, top_k=20) == pytest.approx(0, abs=1e-2)

        preds2 = exp.recommend(users=[1, 2], exclude_known=False)
        assert preds2['user'].unique().tolist() == [1, 2]

        preds = exp.recommend(exclude_known=True)
        joined_preds = preds.join(data.set_index(['user', 'item']),
                                  on=['user', 'item'],
                                  how='inner',
                                  rsuffix="_right")
        assert len(joined_preds) == 0
コード例 #4
0
ファイル: test_NdcgScore.py プロジェクト: kiminh/Alpenglow
    def test_implicit(self):
        ranks = pandas.DataFrame({
            'user': [1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3],
            'item': [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4],
            'rank': [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4],
        })
        test_data = pandas.DataFrame({
            'user': [1, 1, 1, 1, 1, 1, 1, 2, 2, 3],
            'item': [1, 2, 3, 4, 5, 6, 7, 2, 10, 10],
            'score': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
        })

        u2ndcg = (1 / math.log(2 + 1, 2)) / (1 / math.log(2, 2) +
                                             1 / math.log(3, 2))
        assert NdcgScore(test_data, ranks, 5) == np.mean([1, u2ndcg, 0])
コード例 #5
0
ファイル: test_NdcgScore.py プロジェクト: kiminh/Alpenglow
    def test_explicit(self):
        ranks = pandas.DataFrame({
            'user': [1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3],
            'item': [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4],
            'rank': [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4],
        })
        test_data = pandas.DataFrame({
            'user': [1, 1, 1, 1, 1, 1, 1, 2, 2, 3],
            'item': [1, 2, 3, 4, 5, 6, 7, 2, 10, 10],
            'score': [8, 6, 4, 3, 2, 1, 1, 10, 5, 1]
        })

        u2ndcg = (10 / math.log(3, 2)) / (10 / math.log(2, 2) +
                                          5 / math.log(3, 2))
        self.assertAlmostEqual(np.mean([1, u2ndcg, 0]),
                               NdcgScore(test_data, ranks, 5))