def getLoss(X,S):
    n = X.shape[0]
    d = X.shape[1]

    emp_loss = 0 # 0/1 loss
    hinge_loss = 0 # hinge loss
    
    for q in S:
        loss_ijk = getTripletScore(X,q)

        hinge_loss = hinge_loss + max(0,1. - loss_ijk)
            
        if loss_ijk < 0:
            emp_loss = emp_loss + 1.

    emp_loss = emp_loss/len(S)
    hinge_loss = hinge_loss/len(S)

    return emp_loss, hinge_loss
Returns loss on X with respect to list of triplets S: 1/len(S) \sum_{q in S} loss(X,q).
dataset/ETHPy150Open nextml/NEXT/next/apps/PoolBasedTripletMDS/algs/RandomSampling/utilsMDS.py/getLoss