Exemple #1
0
    # create a list of metric classes to be evaluated
    metric = []
    metric.append(ac.HitRate(20))
    metric.append(ac.HitRate(10))
    metric.append(ac.HitRate(5))
    metric.append(ac.HitRate(3))
    metric.append(ac.MRR(20))
    metric.append(ac.MRR(10))
    metric.append(ac.MRR(5))
    metric.append(ac.MRR(3))
    metric.append(cov.Coverage(20))
    metric.append(cov.Coverage(10))
    metric.append(cov.Coverage(5))
    metric.append(cov.Coverage(3))
    metric.append(pop.Popularity(20))
    metric.append(pop.Popularity(10))
    metric.append(pop.Popularity(5))
    metric.append(pop.Popularity(3))
    #     metric.append( div.ArtistDiversity(20) )
    #     metric.append( coh.ArtistCoherence(20) )

    # create a dict of (textual algorithm description => class) to be evaluated
    algs = {}

    #baselines

    mk = markov.MarkovModel()
    algs['markov'] = mk

    sra = sr.SequentialRules(10, weighting='div', pruning=20, last_n_days=None)
Exemple #2
0
            drop = random.choice(drop_outs)
            momentum = random.choice(momentums)
            loss = random.choice(losses)

            export_csv = export_csv_base + str(test_num) + '.csv'

            # create a list of metric classes to be evaluated
            metric = []
            metric.append(ac.HitRate(20))
            metric.append(ac.HitRate(10))
            metric.append(ac.HitRate(3))
            metric.append(ac.MRR(20))
            metric.append(ac.MRR(10))
            metric.append(ac.MRR(3))
            metric.append(cov.Coverage(20))
            metric.append(pop.Popularity(20))

            # create a dict of (textual algorithm description => class) to be evaluated
            algs = {}

            key = 'gru4rec2-' + loss + '-lr' + str(lr) + '-do' + str(
                drop) + '-mom' + str(momentum) + 't' + str(test_num)
            print('TESTING: ' + key)
            drop = float(drop)

            gru = gru4rec2.GRU4Rec(loss=loss,
                                   final_act='linear',
                                   hidden_act='tanh',
                                   layers=[100],
                                   batch_size=64,
                                   dropout_p_hidden=drop,