Esempio n. 1
0
    export_csv = 'results/test-results.csv'

    print(data_path)

    # 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
Esempio n. 2
0
            lr = random.choice(learn_rates)
            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,