0e17f47e9a4920e276bb61b60d6de16264bc6bcf,pythonds/util/aggregation.py,,majority_voting,#Any#Any#,9

Before Change


    
    votes = [clf.predict(query)[0] for clf in ensemble]
    counter = collections.Counter(votes)
    predicted_label = counter.most_common()[0][0]

    return predicted_label

After Change


    predicted_label : The label of the query sample, predicted by the majority voting rule
    
    // Check if a single sample was passed down to the function. In this case the sample must be converted to a 2D array.
    if query.ndim == 1:
        query = np.atleast_2d(query)

    n_samples = query.shape[0]
    votes = np.zeros((n_samples, len(classifier_ensemble)))
    for clf_index, clf in enumerate(classifier_ensemble):
        votes[:, clf_index] = clf.predict(query)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: scikit-learn-contrib/DESlib
Commit Name: 0e17f47e9a4920e276bb61b60d6de16264bc6bcf
Time: 2017-12-29
Author: rafaelmenelau@gmail.com
File Name: pythonds/util/aggregation.py
Class Name:
Method Name: majority_voting


Project Name: OpenNMT/OpenNMT-py
Commit Name: d556116728d4f505eb14be081f29e32212145725
Time: 2017-09-01
Author: bpeters@coli.uni-saarland.de
File Name: onmt/IO.py
Class Name:
Method Name: merge_vocabs


Project Name: rushter/MLAlgorithms
Commit Name: 507a5ef9b0285e118fcbc3f8d9995b8ed37a69e9
Time: 2016-11-18
Author: nh.nicolas.hug@gmail.com
File Name: mla/knn.py
Class Name: KNN
Method Name: _predict_x


Project Name: codelucas/newspaper
Commit Name: 5d6cdbd53544d057a1cf344526ec70e0995b77d1
Time: 2014-12-17
Author: lucasyangpersonal@gmail.com
File Name: newspaper/nlp.py
Class Name:
Method Name: keywords