93c0b4b647e8c942b7681b2dd1f5f4e18ff7dbcd,classification/dataloader.py,,cv_split,#,108

Before Change


    lst_y = [ y for i, y in enumerate(labels) if i%nfold != test_id ]
    test_x = [ x for i, x in enumerate(data) if i%nfold == test_id ]
    test_y = [ y for i, y in enumerate(labels) if i%nfold == test_id ]
    perm = range(len(lst_x))
    random.shuffle(perm)
    M = int(len(lst_x)*0.9)
    train_x = [ lst_x[i] for i in perm[:M] ]
    train_y = [ lst_y[i] for i in perm[:M] ]
    valid_x = [ lst_x[i] for i in perm[M:] ]
    valid_y = [ lst_y[i] for i in perm[M:] ]
    return train_x, train_y, valid_x, valid_y, test_x, test_y

def cv_split2(data, labels, nfold, valid_id):

After Change


    lst_y = [ y for i, y in enumerate(labels) if i%nfold != test_id ]
    test_x = [ x for i, x in enumerate(data) if i%nfold == test_id ]
    test_y = [ y for i, y in enumerate(labels) if i%nfold == test_id ]
    perm = list(range(len(lst_x)))
    random.shuffle(perm)
    M = int(len(lst_x)*0.9)
    train_x = [ lst_x[i] for i in perm[:M] ]
    train_y = [ lst_y[i] for i in perm[:M] ]
    valid_x = [ lst_x[i] for i in perm[M:] ]
    valid_y = [ lst_y[i] for i in perm[M:] ]
    return train_x, train_y, valid_x, valid_y, test_x, test_y

def cv_split2(data, labels, nfold, valid_id):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 8

Non-data size: 3

Instances


Project Name: asappresearch/sru
Commit Name: 93c0b4b647e8c942b7681b2dd1f5f4e18ff7dbcd
Time: 2018-01-31
Author: taolei@csail.mit.edu
File Name: classification/dataloader.py
Class Name:
Method Name: cv_split


Project Name: asappresearch/sru
Commit Name: 93c0b4b647e8c942b7681b2dd1f5f4e18ff7dbcd
Time: 2018-01-31
Author: taolei@csail.mit.edu
File Name: classification/dataloader.py
Class Name:
Method Name: read_SST


Project Name: asappresearch/sru
Commit Name: 93c0b4b647e8c942b7681b2dd1f5f4e18ff7dbcd
Time: 2018-01-31
Author: taolei@csail.mit.edu
File Name: classification/dataloader.py
Class Name:
Method Name: read_SUBJ


Project Name: asappresearch/sru
Commit Name: 93c0b4b647e8c942b7681b2dd1f5f4e18ff7dbcd
Time: 2018-01-31
Author: taolei@csail.mit.edu
File Name: classification/dataloader.py
Class Name:
Method Name: read_TREC


Project Name: asappresearch/sru
Commit Name: 93c0b4b647e8c942b7681b2dd1f5f4e18ff7dbcd
Time: 2018-01-31
Author: taolei@csail.mit.edu
File Name: classification/dataloader.py
Class Name:
Method Name: read_MR


Project Name: asappresearch/sru
Commit Name: 93c0b4b647e8c942b7681b2dd1f5f4e18ff7dbcd
Time: 2018-01-31
Author: taolei@csail.mit.edu
File Name: classification/dataloader.py
Class Name:
Method Name: read_MPQA


Project Name: asappresearch/sru
Commit Name: 7a0d0b10251ecd48ff6721dfbc09f64189fc85ab
Time: 2018-07-25
Author: taolei@csail.mit.edu
File Name: classification/dataloader.py
Class Name:
Method Name: create_batches


Project Name: asappresearch/sru
Commit Name: 93c0b4b647e8c942b7681b2dd1f5f4e18ff7dbcd
Time: 2018-01-31
Author: taolei@csail.mit.edu
File Name: classification/dataloader.py
Class Name:
Method Name: read_CR