-
Notifications
You must be signed in to change notification settings - Fork 841
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug

To Reproduce
import numpy as np
y = np.array([3, 1, 4, 1, 5])
p = np.array([2.5, 0.8, 4.2, 1.2, 4.9])
arr = np.array([y, p]).transpose()
print(arr)
true_order = arr[arr[:, 0].argsort()][::-1, 0]
按照预测值从大到小排序
pred_order = arr[arr[:, 1].argsort()][::-1, 0]
打印排序结果
print("按真实值排序:", true_order)
print("按预测值排序:", pred_order)
then it print :
[[3. 2.5]
[1. 0.8]
[4. 4.2]
[1. 1.2]
[5. 4.9]]
按真实值排序: [5. 4. 3. 1. 1.]
按预测值排序: [5. 4. 3. 1. 1.]
Expected behavior
if change
按照预测值从大到小排序
pred_order = arr[arr[:, 1].argsort()][::-1, 1]
then it will print
[[3. 2.5]
[1. 0.8]
[4. 4.2]
[1. 1.2]
[5. 4.9]]
按真实值排序: [5. 4. 3. 1. 1.]
按预测值排序: [4.9 4.2 2.5 1.2 0.8]
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working