Skip to content
New issue

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

IS it Erro in gini()? #772

Open
craftsliu opened this issue May 7, 2024 · 1 comment
Open

IS it Erro in gini()? #772

craftsliu opened this issue May 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@craftsliu
Copy link

Describe the bug
image
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]

@craftsliu craftsliu added the bug Something isn't working label May 7, 2024
@jeongyoonlee
Copy link
Collaborator

jeongyoonlee commented May 10, 2024

@ppstacy, @paullo0106, @zhenyuz0500, @vincewu51, Can you take a look at this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants