cc331f1d0349fe1675cb0ab541e684f81faf0589,pythonds/base.py,DS,predict,#DS#Any#,215
Before Change
// DS or the knn classifier
if self.with_IH and (self._hardness_region_competence(self.neighbors) <= self.IH_rate):
// use the KNN for prediction if the sample is located in a safe region.
predicted_labels[index] = self.knn.predict(instance.reshape(1, -1))
// Otherwise, use DS for classification
else:
// Check if the dynamic frienemy pruning should be used
After Change
// use the KNN for prediction if the sample is located in a safe region.
// predicted_labels[index] = self.knn.predict(instance)
// Using the pre-calculated set of neighbors to perform the decision
y_neighbors = [self.DSEL_target[neighbor_idx] for neighbor_idx in self.neighbors]
predicted_labels[index], _ = mode(y_neighbors)
// Otherwise, use DS for classification
else:
// Check if the dynamic frienemy pruning should be used
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances Project Name: scikit-learn-contrib/DESlib
Commit Name: cc331f1d0349fe1675cb0ab541e684f81faf0589
Time: 2018-01-04
Author: rafaelmenelau@gmail.com
File Name: pythonds/base.py
Class Name: DS
Method Name: predict
Project Name: scikit-learn-contrib/DESlib
Commit Name: bba1901f835525551dde9ec1537d041abc88d293
Time: 2021-04-08
Author: rafaelmenelau@gmail.com
File Name: deslib/static/oracle.py
Class Name: Oracle
Method Name: predict
Project Name: donlnz/nonconformist
Commit Name: aab2ef03ff533c1160742fafd2bf12133e227ddb
Time: 2015-03-19
Author: henrik.linusson@gmail.com
File Name: nonconformist/ensemble.py
Class Name: AggregatedCp
Method Name: predict
Project Name: scikit-learn-contrib/DESlib
Commit Name: cc331f1d0349fe1675cb0ab541e684f81faf0589
Time: 2018-01-04
Author: rafaelmenelau@gmail.com
File Name: pythonds/base.py
Class Name: DS
Method Name: predict