// if no_diff is True, that means all features do not have a significant difference in weights between previous and current run.
no_diff = True
// if first iteration, set false
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)