def main():
    
    # generate some fake data
    n = 30
    d = 2
    m = int(ceil(40*n*d*log(n)))  # number of labels
    
    p = 0.1; # error rate
    
    Strain = []
    Stest = []
    Xtrue = randn(n,d);
    for iter in range(0,m):

        # get random triplet
        q,score = getRandomQuery(Xtrue)

        # align it so it agrees with Xtrue: "q[2] is more similar to q[0] than q[1]"
        query_ordering_disagrees_with_Xtrue = score<0
        if query_ordering_disagrees_with_Xtrue:
            q = [ q[i] for i in [1,0,2]]

        # add some noise
        R = rand()
        if R<p:
            q = [ q[i] for i in [1,0,2]]

        if iter < .9*m:
            Strain.append(q)
        else:
            Stest.append(q)


    # compute embedding 
    X,emp_loss_train = computeEmbedding(n,d,Strain,num_random_restarts=2,epsilon=0.01,verbose=True)

    # compute loss on test set
    emp_loss_test,hinge_loss_test = getLoss(X,Stest)

    print
    print 'Training loss = %f,   Test loss = %f' %(emp_loss_train,emp_loss_test)
Initialize virtual trackball control.
dataset/ETHPy150Open nextml/NEXT/next/apps/PoolBasedTripletMDS/algs/RandomSampling/utilsMDS.py/main--crossover with--dataset/ETHPy150Open omangin/multimodal/multimodal/lib/transformations.py/Arcball.__init__