Exemplo n.º 1
0

            mycase = assayname + '_' +str(fold_id)
            mycasemore = mycase + '_pct_' + str(encoding_rate)+'_epochs_100_sigmoid' 


            test_path = 'encoder/testdata_sampled_encoded_new/' + mycasemore + '.test'

            if rank_function == 0:
                pred_path = 'svm_rank_pred_sampled_new/' + mycasemore + '.pred'

            else:
                pred_path = 'svm_light_pred_sampled_new/' + mycasemore + '.pred'


            [ndcg10,ndcg5,ndcgall, rank_length] = get_ndcg(test_path, pred_path,only_active=0)

            if ndcg5 != 0:
                ndcg5_this_assay.append(ndcg5)
            else:
                print 'empty path', test_path, pred_path
            if ndcg10 != 0:
                ndcg10_this_assay.append(ndcg10)
            if ndcgall != 0:
                ndcgall_this_assay.append(ndcgall)

            # average of the ndcg
            avg_ndcg10 = numpy.average(ndcg10_this_assay)
            avg_ndcg5 = numpy.average(ndcg5_this_assay)
            avg_ndcgall= numpy.average(ndcgall_this_assay)
Exemplo n.º 2
0
            ndcgall_this_assay = []

            mycase = assayname + '_' + str(fold_id)
            mycasemore = mycase + '_pct_' + str(
                encoding_rate) + '_epochs_100_sigmoid'

            test_path = 'encoder/testdata_sampled_encoded_new/' + mycasemore + '.test'

            if rank_function == 0:
                pred_path = 'svm_rank_pred_sampled_new/' + mycasemore + '.pred'

            else:
                pred_path = 'svm_light_pred_sampled_new/' + mycasemore + '.pred'

            [ndcg10, ndcg5, ndcgall, rank_length] = get_ndcg(test_path,
                                                             pred_path,
                                                             only_active=0)

            if ndcg5 != 0:
                ndcg5_this_assay.append(ndcg5)
            else:
                print 'empty path', test_path, pred_path
            if ndcg10 != 0:
                ndcg10_this_assay.append(ndcg10)
            if ndcgall != 0:
                ndcgall_this_assay.append(ndcgall)

            # average of the ndcg
            avg_ndcg10 = numpy.average(ndcg10_this_assay)
            avg_ndcg5 = numpy.average(ndcg5_this_assay)
            avg_ndcgall = numpy.average(ndcgall_this_assay)
Exemplo n.º 3
0

            mycase = assayname + '_' +str(fold_id)
            mycasemore = mycase + '_pct_' + str(encoding_rate)+'_epochs_100_only_nz' 


            test_path = 'encoder/testdata_sampled_encoded_new/' + mycasemore + '.test'

            if rank_function == 0:
                pred_path = 'svm_rank_pred_sampled_new/' + mycasemore + '.pred'

            else:
                pred_path = 'svm_light_pred_sampled_new/' + mycasemore + '.pred'


            [ndcg10,ndcg5,ndcgall, rank_length] = get_ndcg(test_path, pred_path, 1)

            if ndcg5 != 0:
                ndcg5_this_assay.append(ndcg5)
            else:
                print 'empty path', test_path, pred_path
            if ndcg10 != 0:
                ndcg10_this_assay.append(ndcg10)
            if ndcgall != 0:
                ndcgall_this_assay.append(ndcgall)

            # average of the ndcg
            avg_ndcg10 = numpy.average(ndcg10_this_assay)
            avg_ndcg5 = numpy.average(ndcg5_this_assay)
            avg_ndcgall= numpy.average(ndcgall_this_assay)