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

Decimal points in plot method #451

Open
tanjiu opened this issue Aug 19, 2022 · 9 comments
Open

Decimal points in plot method #451

tanjiu opened this issue Aug 19, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@tanjiu
Copy link

tanjiu commented Aug 19, 2022

Description

百分比的混淆矩阵计算出来的位数太长,保存下来的图片数据是重合的,请问是否有办法设置一下小数点位数?真的十分感谢解答!!!
image

Steps/Code to Reproduce

这是我的代码:
cm = ConfusionMatrix(actual_vector=y_trueLabel, predict_vector=y_predictLabel, digit=4)
cm.plot(cmap=plt.cm.Reds, normalized=True, number_label=True, plot_lib="matplotlib")
plt.xticks(rotation=45)
plt.savefig(fname="C:\Users\Graduate01\Desktop\222\%s" % '235')

Expected Behavior

Actual Behavior

Operating System

Python Version

PyCM Version (Use : pycm.__version__)

@sadrasabouri
Copy link
Collaborator

I wonder if we wanted to add this particular feature in the near future, right @sepandhaghighi ?

@tanjiu
Copy link
Author

tanjiu commented Aug 20, 2022

我想知道我们是否想在不久的将来添加这个特殊功能,对吧@sepandhaghighi?

如果可以的话,可不可以再调整一下画出来的混淆矩阵的重叠问题,我发现在类别较多的时候显示还是会重叠,例如下面这样:
image

@sadrasabouri
Copy link
Collaborator

This is another issue. We should take care of it, too.

@sepandhaghighi
Copy link
Owner

sepandhaghighi commented Aug 20, 2022

I wonder if we wanted to add this particular feature in the near future, right @sepandhaghighi ?

This is a bug that we have to fix one day. But I also think that we will work on it in the next 3- 4 versions.

Similar to #430

@sepandhaghighi sepandhaghighi changed the title 很抱歉我实在是太菜了,我没有找到控制百分比的混淆矩阵的小数点位数的方法 Decimal points in plot method Aug 20, 2022
@sepandhaghighi sepandhaghighi added the bug Something isn't working label Aug 20, 2022
@sepandhaghighi
Copy link
Owner

This is another issue. We should take care of it, too.

I think in problems with a large number of classes, it is not possible to display the numbers in the table (like Example 7). This is not a PyCM problem.
Do you have any idea?

@sadrasabouri
Copy link
Collaborator

It may be a good workaround if we add a parameter for font size. This would help us.

@tanjiu
Copy link
Author

tanjiu commented Aug 21, 2022

这是另一个问题。我们也应该照顾它。

我认为在有大量类的问题中,不可能在表格中显示数字(如示例 7)。这不是 PyCM 问题。 你有什么主意吗?

我的混淆矩阵用18类进行测试的,然后我发现如果可以把plot.show()的图片最大化,基本上可以正常显示,百分比的图只需要控制一下小数点位数就可以了,不过这需要每次都要手动点击右上角的最大化按钮,我之前曾经尝试过自动将图片最大化保存,但是最终没有成功,我想你们可不可以加一个最大化显示图片的功能,这样就完美了,我的编程能力实在是太菜了,不得已向你们提出这个请求,非常感谢如果你们能够接受这个建议的话。最大化图片的实际显示效果如下:
image
194a5d6e376d6e51000eeb7e4404236

@sadrasabouri

@sepandhaghighi
Copy link
Owner

It may be a good workaround if we add a parameter for font size. This would help us.

Nice approach! We should test it.

@tanjiu
Copy link
Author

tanjiu commented Aug 21, 2022

如果我们为字体大小添加一个参数,这可能是一个很好的解决方法。这会对我们有所帮助。

不错的方法!我们应该对其进行测试。

我认为让图片最大化保存也是一个更合适的方法,这样可以避免字体过小显示效果不好的情况

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

3 participants