We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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]
The text was updated successfully, but these errors were encountered:
@ppstacy, @paullo0106, @zhenyuz0500, @vincewu51, Can you take a look at this issue?
Sorry, something went wrong.
No branches or pull requests
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]
The text was updated successfully, but these errors were encountered: