Exemplo n.º 1
0
    def get_algs():
        # create a dict of (textual algorithm description => class) to be evaluated
        algs = {}

        ara = ar.AssosiationRules()
        algs['ar'] = ara
        del ara

        sra = sr.SequentialRules(10, weighting='div', pruning=20)
        algs['sr10-div'] = sra
        del sra

        sknna = sknn.ContextKNN(500, 1000, similarity="cosine")
        algs['sknn-500-1000-cosine'] = sknna
        del sknna

        ssknna = ssknn.SeqContextKNN(100, 500, similarity="cosine")
        algs['ssknn-100-500-cosine'] = ssknna
        del ssknna

        knn = sfsknn.SeqFilterContextKNN(100, 500, similarity="cosine")
        algs['sfknn-100-500-cosine'] = knn
        del knn

        vsknna = vsknn.VMContextKNN(100, 1000, similarity="cosine")
        algs['svmknn-100-1000-cosine'] = vsknna

        vsknna = vsknn.VMContextKNN(100, 2000, similarity="cosine")
        algs['svmknn-100-2000-cosine'] = vsknna
        del vsknna

        grunew = gru4rec2.GRU4Rec(loss='bpr-max-0.5',
                                  final_act='linear',
                                  hidden_act='tanh',
                                  layers=[100],
                                  batch_size=32,
                                  dropout_p_hidden=0.0,
                                  learning_rate=0.2,
                                  momentum=0.5,
                                  n_sample=2048,
                                  sample_alpha=0,
                                  time_sort=True)
        algs['gru-100-bpr-max-0.5'] = grunew
        del grunew

        return algs
Exemplo n.º 2
0
 #     algs['sr10-div'] = sra
 #
 #     ara = ar.AssosiationRules();
 #     algs['ar'] = ara
 #
 #     #knn
 #
 #     iknn = iknn.ItemKNN()
 #     algs['iknn'] = iknn
 #
 #     sknn = sknn.ContextKNN( 100, 500, similarity="cosine", extend=False )
 #     algs['sknn-100-500-cosine'] = sknn
 #
 vmsknn = vsknn.VMContextKNN(100,
                             2000,
                             similarity="cosine",
                             last_n_days=None,
                             extend=False)
 algs['vsknn-200-2000-cosine'] = vmsknn
 #
 #     ssknn = ssknn.SeqContextKNN( 100, 500, similarity="cosine", extend=False )
 #     algs['ssknn-100-500-cosine-div'] = ssknn
 #
 #     sfsknn = sfsknn.SeqFilterContextKNN( 100, 500, similarity="cosine", extend=False )
 #     algs['sfsknn-100-500-cosine-div'] = ssknn
 #
 #     #gr4rec2
 #
 #     gru = gru4rec2.GRU4Rec(n_epochs=10, loss='bpr-max-0.5', final_act='linear', hidden_act='tanh', layers=[100], batch_size=32, dropout_p_hidden=0.0, learning_rate=0.2, momentum=0.5, n_sample=2048, sample_alpha=0, time_sort=True)
 #     algs['gru-100-bpr-max-0.5'] = gru
 #