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

Posteriors from binary:logistic #25

Closed
HoD3521 opened this issue Aug 15, 2014 · 12 comments
Closed

Posteriors from binary:logistic #25

HoD3521 opened this issue Aug 15, 2014 · 12 comments

Comments

@HoD3521
Copy link

HoD3521 commented Aug 15, 2014

When I use param['objective'] = 'binary:logistic' the range of output values is not in [0,1] as mentioned in the wiki.

Is there something else I must do to get the posterior probability?

thanks

j

@tqchen
Copy link
Member

tqchen commented Aug 15, 2014

This is strange, the option is sufficient for getting the posterior probability. Maybe you can post a minimal script that reproduce the error.

@HoD3521
Copy link
Author

HoD3521 commented Aug 15, 2014

Hey

This is the Higgs script that you posted previously, slightly modified:

# setup parameters for xgboost
param = {}
# use logistic regression loss, use raw prediction before logistic transformation
# since we only need the rank
param['objective'] = 'binary:logistic'
# scale weight of positive examples
param['scale_pos_weight'] = sum_wneg/sum_wpos
param['bst:eta'] = 0.1 
param['bst:max_depth'] = 6
param['bst:subsample'] = 0.4
param['eval_metric'] = 'auc'
param['silent'] = 1
param['nthread'] = 16
param['booster_type'] = 0 #0 = trees, 1=linear

Thanks for the quick reply.

j

@tqchen
Copy link
Member

tqchen commented Aug 15, 2014

This is because the xgboost does not remember objective in model in past version, and when you load it with empty parameter, it does not remember the option.

I have made a fix to the problem, check out the most recent version and see if it fixes your problem.

@tqchen tqchen closed this as completed Aug 15, 2014
@tqchen tqchen reopened this Aug 15, 2014
@HoD3521
Copy link
Author

HoD3521 commented Aug 15, 2014

You mean I have to reload param when I predict?

I will check the fix and let you know - appreciate the help.

j

@tqchen
Copy link
Member

tqchen commented Aug 15, 2014

In the old version, when you load the model, you create a Booster with param that contains the same objective. The newest version should solve the problem

@HoD3521
Copy link
Author

HoD3521 commented Aug 16, 2014

I downloaded the new version, hit make (needed to remove -fopenmp flag), but libxboostpy.so was not generated so I got a traceback when xgboost was imported.

I kept the old version in xgboost_archive directory.

Any suggestions?

j

@tqchen
Copy link
Member

tqchen commented Aug 16, 2014

If this is a compilation issue, pls report the compiler message. you need
to make in python folder

On Friday, August 15, 2014, HoD3521 notifications@github.com wrote:

I downloaded the new version, hit make (needed to remove -fopenmp flag),
but libxboostpy.so was not generated so I got a traceback when xgboost was
imported.

I kept the old version in xgboost_archive directory.

Any suggestions?

j


Reply to this email directly or view it on GitHub
https://github.com/tqchen/xgboost/issues/25#issuecomment-52375332.

Sincerely,

Tianqi Chen
Computer Science & Engineering, University of Washington

@HoD3521
Copy link
Author

HoD3521 commented Aug 16, 2014

$ /usr/bin/python -u higgs-numpy.py
../../python
../../python/libxgboostpy.so
Traceback (most recent call last):
File "higgs-numpy.py", line 15, in
import xgboost as xgb
File "../../python/xgboost.py", line 20, in
xglib = ctypes.cdll.LoadLibrary(XGBOOST_PATH)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/init.py", line 443, in LoadLibrary
return self._dlltype(name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/init.py", line 365, in init
self._handle = _dlopen(self._name, mode)
OSError: dlopen(../../python/libxgboostpy.so, 6): image not found

@HoD3521
Copy link
Author

HoD3521 commented Aug 16, 2014

Let me try making in python folder and get back to you.

@HoD3521
Copy link
Author

HoD3521 commented Aug 16, 2014

making in the python folder worked - thanks.

@HoD3521
Copy link
Author

HoD3521 commented Aug 16, 2014

And the posteriors look correct. Really appreciate the help.

j

@tqchen tqchen closed this as completed Aug 16, 2014
@tqchen
Copy link
Member

tqchen commented Aug 16, 2014

I am glad it works out for you. Thank you for using xgboost

tqchen added a commit that referenced this issue Oct 21, 2015
e81a11d Merge pull request #25 from daiyl0320/master
35c3b37 add retry mechanism to ConnectTracker and modify Listen backlog to 128 in rabit_traker.py
c71ed6f try deply doxygen
62e5647 try deply doxygen
732f1c6 try
2fa6e02 ok
0537665 minor
7b59dcb minor
5934950 new doc
f538187 ok
44b6049 new doc
387339b add more
9d4397a chg
2879a48 chg
30e3110 ok
9ff0301 add link translation
6b629c2 k
32e1955 ok
8f4839d fix
93137b2 ok
7eeeb79 reload recommonmark
a8f00cc minor
19b0f01 ok
dd01184 minor
c1cdc19 minor
fcf0f43 try rst
cbc21ae try
62ddfa7 tiny
aefc05c final change
2aee9b4 minor
fe4e7c2 ok
8001983 change to subtitle
5ca33e4 ok
88f7d24 update guide
29d43ab add code
fe8bb3b minor hack for readthedocs
229c71d Merge branch 'master' of ssh://github.com/dmlc/rabit
7424218 ok
d1d45bb Update README.md
1e8813f Update README.md
1ccc990 Update README.md
0323e06 remove readme
679a835 remove theme
7ea5b7c remove numpydoc to napoleon
b73e2be Merge branch 'master' of ssh://github.com/dmlc/rabit
1742283 ok
1838e25 Update python-requirements.txt
bc4e957 ok
fba6fc2 ok
0251101 ok
d50b905 ok
d4f2509 ok
cdf401a ok
fef0ef2 new doc
cef360d ok
c125d2a ok
270a49e add requirments
744f901 get the basic doc
1cb5cad Merge branch 'master' of ssh://github.com/dmlc/rabit
8cc07ba minor
d74f126 Update .travis.yml
52b3dcd Update .travis.yml
099581b Update .travis.yml
1258046 Update .travis.yml
7addac9 Update Makefile
0ea7adf Update .travis.yml
f858856 Update travis_script.sh
d8eac4a Update README.md
3cc49ad lint and travis
ceedf4e fix
fd8920c fix win32
8bbed35 modify
9520b90 Merge pull request #14 from dmlc/hjk41
df14bb1 fix type
f441dc7 replace tab with blankspace
2467942 remove unnecessary include
181ef47 defined long long and ulonglong
1582180 use int32_t to define int and int64_t to define long. in VC long is 32bit
e0b7da0 fix

git-subtree-dir: subtree/rabit
git-subtree-split: e81a11d
@lock lock bot locked as resolved and limited conversation to collaborators Oct 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants