163eb7df13667e21b0e02a2706e18d1f53eee610,skrebate/iterrelief.py,IterRelief,fit,#IterRelief#,69
Before Change
// Iterate till max iteration reached or all weights are really tiny
while ((iteration < self.max_iter) & (any(w >= 0.0001 for w in distance_weights))):
// Run Core Relief-based algorithm
core_fit = core.fit(self.X_mat, self._y, distance_weights, self.weight_flag)
After Change
if iteration == 0:
no_diff = False
else:
for i in range(len(feature_weights)):
//previous array of feature_weights
prev = weight_history[len(weight_history)-1]
diff = abs(prev[i] - feature_weights[i])
// first encounter of value that has difference greater than threshold, set no_diff to False, and break out of checking loop
if diff >= 0.0001:
no_diff = False
break;
if no_diff:
break;
mx = max(feature_weights)
weight_history.append(feature_weights)
//normalize and update scores
//negative numbers -> 0, positive numbers become normalized so maximum is 1.
for i in range(0, len(feature_weights)):
if feature_weights[i] <= 0:
feature_weights[i] = 0
else:
feature_weights[i] = feature_weights[i] / mx
distance_weights += feature_weights
iteration += 1
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 11
Instances Project Name: EpistasisLab/scikit-rebate
Commit Name: 163eb7df13667e21b0e02a2706e18d1f53eee610
Time: 2020-01-29
Author: alexmxu99@gmail.com
File Name: skrebate/iterrelief.py
Class Name: IterRelief
Method Name: fit
Project Name: EpistasisLab/scikit-rebate
Commit Name: 163eb7df13667e21b0e02a2706e18d1f53eee610
Time: 2020-01-29
Author: alexmxu99@gmail.com
File Name: skrebate/iterrelief.py
Class Name: IterRelief
Method Name: fit
Project Name: Unity-Technologies/ml-agents
Commit Name: 2ab8d843f4fd933958e2022261a1264ba61ee3db
Time: 2020-12-23
Author: vincentpierre@unity3d.com
File Name: ml-agents/mlagents/trainers/policy/policy.py
Class Name: Policy
Method Name: __init__
Project Name: EpistasisLab/scikit-rebate
Commit Name: ece383696800b9b34854df27a65a3d1d74669952
Time: 2020-05-28
Author: alexmxu@alexs-mbp-3.attlocal.net
File Name: skrebate/iterrelief.py
Class Name: IterRelief
Method Name: fit