c8abe38d8c4306ad3430cf4c33e7809ad973df3f,Orange/classification/softmax_regression.py,,,#,60

Before Change


//    print(ga)
//    print(gn)

    for lambda_ in [0.1, 0.3, 1, 3, 10]:
        m = SoftmaxRegressionLearner(lambda_=lambda_)
        scores = []
        for tr_ind, te_ind in StratifiedKFold(d.Y.ravel()):
            s = np.mean(m(d[tr_ind])(d[te_ind]) == d[te_ind].Y.ravel())
            scores.append(s)
        print("{:4.1f} {}".format(lambda_, np.mean(scores)))

After Change


    // gradient check
    m = SoftmaxRegressionLearner(lambda_=1.0)
    m.num_classes = 3
    Theta = np.random.randn(3 * 4)
    y = d.Y.ravel().astype(int)
    Y = np.eye(3)[y]

    ga = m.cost_grad(Theta, d.X, Y, y)[1]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: biolab/orange3
Commit Name: c8abe38d8c4306ad3430cf4c33e7809ad973df3f
Time: 2013-06-03
Author: jure.zbontar@gmail.com
File Name: Orange/classification/softmax_regression.py
Class Name:
Method Name:


Project Name: librosa/librosa
Commit Name: 090251215afe3119852678f0b43f950398ee3224
Time: 2015-08-25
Author: brian.mcfee@nyu.edu
File Name: tests/test_core.py
Class Name:
Method Name: test_autocorrelate


Project Name: nilearn/nilearn
Commit Name: 38b1a68f9f74ebb1a0f8cf2f73a9e606f7c022c2
Time: 2015-07-28
Author: elvis.dohmatob@inria.fr
File Name: nilearn/decoding/tests/test_same_api.py
Class Name:
Method Name: test_smoothlasso_and_tv_same_for_pure_l1_another_test