// Determine total number of features
total_num_features = X.shape[1]
print("num featuers")
print(total_num_features)
// Initialize weights
distance_weights = np.ones(total_num_features)
After Change
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