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

predict_proba() #1

Open
flyzaway opened this issue Nov 3, 2017 · 4 comments
Open

predict_proba() #1

flyzaway opened this issue Nov 3, 2017 · 4 comments

Comments

@flyzaway
Copy link

flyzaway commented Nov 3, 2017

clf.predict_proba(X_test)[:,1] ##预测概率请问为什么这里的概率是第一列的概率呢?

@willduan
Copy link

willduan commented Nov 3, 2017

一般来说predict_proba 输出的形式如下

[[0.3,0.7],
[0.6,0.4]]

行是sample的个数,每一行为一个样本的预测概率,第0列是label = neg的概率,第1列是label = pos的概率,这里需要的只是pos的概率,所以输出所有样本第一列的概率咯。你可以把后面那个去掉看看结果。

@flyzaway
Copy link
Author

flyzaway commented Nov 3, 2017

懂了,您这里指得是二分类;
还想请教一下对于多分类而言,调节min_child_weight,scale_pos_weight这两个参数会对类别不平衡有帮助么?

@lytforgood
Copy link
Owner

lytforgood commented Nov 3, 2017 via email

@lytforgood
Copy link
Owner

lytforgood commented Nov 3, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants