entropies_with_samples = []
for i in range(0,2948):
entr = entropy(predictProbas[i])
mixed = [proba_X_train[i],entr]
entropies_with_samples.append(mixed)
a = np.array(entropies_with_samples)
a.flatten("F")
print(list(chain.from_iterable(entropies_with_samples)))
selection = (sorted(mixed, key=itemgetter(2),reverse= True))
print(selection)
example:
input = [([0.2,0.10]),0.69, ([0.3,0.67]),0.70, ([0.5,0.68]),0.70, ([0.3,0.67]),0.65]
I'm trying to sort such an array at the third position.
output = [([0.3,0.67]),0.70, ([0.5,0.68]),0.70, ([0.2,0.10]),0.69, ([0.3,0.67]),0.65 ]