8115a167b0f280a62aa0d5560709ab9790d96e15,deslib/util/aggregation.py,,weighted_majority_voting_rule,#Any#Any#Any#,125
Before Change
for idx in range(n_samples):
for label in labels_set:
w_votes[idx, np.where(labels_set == label)] = sum(
weights[idx, votes[idx] == label])
predicted_label = labels_set[np.argmax(w_votes, axis=1)]
After Change
n_samples = votes.shape[0]
w_votes = np.zeros((len(labels_set), n_samples))
ma_weights = weights.view(np.ma.MaskedArray)
for ind, label in enumerate(labels_set):
ma_weights.mask = votes != label
w_votes[ind, :] = ma_weights.sum(axis=1)
predicted_label = labels_set[np.argmax(w_votes, axis=0)]
return predicted_label
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: scikit-learn-contrib/DESlib
Commit Name: 8115a167b0f280a62aa0d5560709ab9790d96e15
Time: 2020-05-19
Author: rafaelmenelau@gmail.com
File Name: deslib/util/aggregation.py
Class Name:
Method Name: weighted_majority_voting_rule
Project Name: deepmind/dm_control
Commit Name: d29c32aa292cf4cedb5477b69621f30a8b62bd9f
Time: 2018-10-10
Author: alimuldal@google.com
File Name: dm_control/mujoco/engine.py
Class Name: Physics
Method Name: check_invalid_state
Project Name: prody/ProDy
Commit Name: 3093971a619fcb98f05f9a5f7b4835c8c37392a9
Time: 2018-07-04
Author: ponzoniluca@gmail.com
File Name: prody/domain_decomposition/spectrus.py
Class Name:
Method Name: _removeOutliers