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

[Add] f1_score/precision_score/recall_score/accuracy_score #405

Merged
merged 22 commits into from
Nov 19, 2023

Conversation

tarantula-leo
Copy link
Contributor

Pull Request

What problem does this PR solve?

Issue Number: Fixed #383

Possible side effects?

  • Performance: support multi-classification

  • Backward compatibility:

@tarantula-leo
Copy link
Contributor Author

@deadlywing simulation和emulation是要新建还是在原本文件基础上改?

@deadlywing
Copy link
Contributor

在原文件上增加吧

@deadlywing simulation和emulation是要新建还是在原本文件基础上改?

直接在原文件上增加吧~

@tarantula-leo
Copy link
Contributor Author

@deadlywing emul的测试环境还是有些问题,看下是否可以执行

@deadlywing
Copy link
Contributor

@deadlywing emul的测试环境还是有些问题,看下是否可以执行

问题在于emulator关闭channel需要一点时间,所以最好在全局使用一个emulator。
可以参考:https://github.com/secretflow/spu/blob/main/sml/linear_model/emulations/logistic_emul.py

BTW,原本的emul文件里,那个测试函数名是emul_SGDClassifier,不太符合实际含义,麻烦顺便改成emul_auc
同样,test文件里的test_simple也改成test_auc

Thanks~

@tarantula-leo
Copy link
Contributor Author

emul文件可以测试通过么 是不是只有两个函数名称需要修改?

@deadlywing
Copy link
Contributor

emul文件可以测试通过么 是不是只有两个函数名称需要修改?

emul需要修改一下,把emulator放到全局去,一次up和down~
可参考:https://github.com/secretflow/spu/blob/main/sml/linear_model/emulations/logistic_emul.py

sml/metrics/classification/classification.py Outdated Show resolved Hide resolved
sml/metrics/classification/classification.py Outdated Show resolved Hide resolved
sml/metrics/classification/classification.py Outdated Show resolved Hide resolved
sml/metrics/classification/classification.py Outdated Show resolved Hide resolved
sml/metrics/classification/classification_emul.py Outdated Show resolved Hide resolved
Copy link
Contributor

@deadlywing deadlywing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@deadlywing deadlywing merged commit 5746ad0 into secretflow:main Nov 19, 2023
8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

在 SML 中实现 metric 算子(分类)
2 participants