317 Commits

Author SHA1 Message Date
Philip Hyunsu Cho
4df246191f
Add warning when save_model() is called from scikit-learn interface (#4632) 2019-07-03 23:37:53 -07:00
Oleksandr Pryimak
986fee6022 pytest tests/python fails if no pandas installed (#4620)
* _maybe_pandas_xxx should return their arguments unchanged if no pandas installed

* Tests should not assume pandas is installed

* Mark tests which require pandas as such
2019-07-01 02:54:08 +08:00
Philip Hyunsu Cho
a30176907f
Support Dask 2.0 (#4617) 2019-06-27 20:42:35 -07:00
Jiaming Yuan
8bdf15120a
Implement tree model dump with code generator. (#4602)
* Implement tree model dump with a code generator.

* Split up generators.
* Implement graphviz generator.
* Use pattern matching.

* [Breaking] Return a Source in `to_graphviz` instead of Digraph in Python package.


Co-Authored-By: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
2019-06-26 15:20:44 +08:00
Jiaming Yuan
2cff735126
Update doc for feature constraints and n_gpus. (#4596)
* Update doc for feature constraints. 

* Fix some warnings.

* Clean up doc for `n_gpus`.
2019-06-23 14:37:22 +08:00
Andy Adinets
9fa29ad753 Set reg_lambda=1e-5 for scikit-learn-like random forest classes. (#4558) 2019-06-22 08:02:13 +12:00
Philip Hyunsu Cho
30e1cb4e9e Fix docstring for XGBModel.predict() [skip ci] (#4592) 2019-06-21 12:44:42 +08:00
Jiaming Yuan
9494950ee7 Address some sphinx warnings and errors, add doc for building doc. (#4589) 2019-06-20 15:07:36 -07:00
Jiaming Yuan
4591039eba
Remove remaining reg:linear. (#4544) 2019-06-11 16:04:09 +08:00
Jiaming Yuan
4e9965cb9d
Fix Python demo and doc. (#4545)
* Remove old doc.
* Fix checking __stdin__.
2019-06-11 08:58:41 +08:00
Philip Hyunsu Cho
c2a3902ba3
Fix #4497: Enable feature importance property for DART booster (#4525) 2019-05-31 15:11:57 -07:00
Rory Mitchell
972f693eaf
Fix dask API sphinx docstrings (#4507)
* Fix dask API sphinx docstrings

* Update GPU docs page
2019-05-28 16:39:26 +12:00
yellowdolphin
3f7e5d9c47 add dll_path for cygwin users (#4499) 2019-05-27 12:04:28 +08:00
Rory Mitchell
09b90d9329
Add native support for Dask (#4473)
* Add native support for Dask

* Add multi-GPU demo

* Add sklearn example
2019-05-27 13:29:28 +12:00
Bryan Woods
278562db13 Add support for cross-validation using query ID (#4474)
* adding support for matrix slicing with query ID for cross-validation

* hail mary test of unrar installation for windows tests

* trying to modify tests to run in Github CI

* Remove dependency on wget and unrar

* Save error log from R test

* Relax assertion in test_training

* Use int instead of bool in C function interface

* Revise R interface

* Add XGDMatrixSliceDMatrixEx and keep old XGDMatrixSliceDMatrix for API compatibility
2019-05-23 10:45:02 -07:00
Sean Owen
5a567ec249 Ensure pandas DataFrame column names are treated as strings in type error message (#4481) 2019-05-21 16:19:35 +08:00
Philip Hyunsu Cho
515f5f5c47
[RFC] Version 0.90 release candidate (#4475)
* Release 0.90

* Add script to automatically generate acknowledgment

* Update NEWS.md
2019-05-20 01:02:44 -07:00
Philip Hyunsu Cho
bbe0dbd7ec
Migrate pylint check to Python 3 (#4381)
* Migrate lint to Python 3

* Fix lint errors

* Use Miniconda3 to use Python 3.7

* Use latest pylint and astroid
2019-04-21 01:01:54 -07:00
Mayank Suman
360f25ec27 Added language classifier for python (#4327)
* Added language classifier for python

* Removed python2 language classifier

* Fix formatting
2019-04-08 11:13:26 -07:00
Jiaming Yuan
82dca3c108
Don't store DMatrix handle until it's initialized. (#4317)
* Use a temporary variable to store the handle.
* Decode c++ error message.
* Simple note about saved binary.
2019-04-01 18:29:28 +08:00
Philip Hyunsu Cho
263e2038e9
Bump Python version number (#4285) 2019-03-21 14:40:44 -07:00
Jiaming Yuan
7b1b11390a
Mark Scikit-Learn RF interface as experimental in doc. (#4258)
* Mark Scikit-Learn RF interface as experimental in doc.
2019-03-16 00:45:32 +08:00
Andy Adinets
4352fcdb15 Brought the silent parameter for the SKLearn-like API back, marked it deprecated. (#4255)
* Brought the silent parameter for the SKLearn-like API back, marked it deprecated.

- added deprecation notice and warning
- removed silent from the tests for the SKLearn-like API
2019-03-14 09:45:08 +13:00
Andy Adinets
a36c3ed4f4 Added SKLearn-like random forest Python API. (#4148)
* Added SKLearn-like random forest Python API.

- added XGBRFClassifier and XGBRFRegressor classes to SKL-like xgboost API
- also added n_gpus and gpu_id parameters to SKL classes
- added documentation describing how to use xgboost for random forests,
  as well as existing caveats
2019-03-12 22:28:19 +08:00
Patrick Ford
74009afcac Added trees_to_df() method for Booster class (#4153)
* add test_parse_tree.py to tests/python

* Fix formatting

* Fix pylint error

* Ignore 'no member' error for Pandas dataframe
2019-02-26 13:28:24 -08:00
Abhai Kollara Dilip
54793544a2 Update README.rst (#4167)
Fixes error when copy pasting.
2019-02-20 14:46:56 -08:00
Philip Hyunsu Cho
2aaae2e7bb
Fix #4163: always copy sliced data (#4165)
* Revert "Accept numpy array view. (#4147)"

This reverts commit a985a99cf0dacb26a5d734835473d492d3c2a0df.

* Fix #4163: always copy sliced data

* Remove print() from the test; check shape equality

* Check if 'base' attribute exists

* Fix lint

* Address reviewer comment

* Fix lint
2019-02-20 14:46:34 -08:00
Jiaming Yuan
a985a99cf0
Accept numpy array view. (#4147)
* Accept array view (slice) in metainfo.
2019-02-18 22:21:34 +08:00
Pasha Stetsenko
ff2d4c99fa Update datatable usage (#4123) 2019-02-17 03:44:09 +08:00
Rong Ou
3be1b9ae30 reformat benchmark_tree.py to get rid of lint errors (#4126) 2019-02-13 18:54:56 +13:00
Philip Hyunsu Cho
99a290489c
Update Python docstring for ranking functions (#4121)
* Update Python docstring for ranking functions

* Fix formatting
2019-02-10 12:22:02 -08:00
Jiaming Yuan
1088dff42c Prevent training without setting up caches. (#4066)
* Prevent training without setting up caches.

* Add warning for internal functions.
* Check number of features.

* Address reviewer's comment.
2019-02-03 01:03:29 -08:00
tmitanitky
59f868bc60 enable xgb_model in scklearn XGBClassifier and test. (#4092)
* Enable xgb_model parameter in XGClassifier scikit-learn API

https://github.com/dmlc/xgboost/issues/3049

* add test_XGBClassifier_resume():

test for xgb_model parameter in XGBClassifier API.

* Update test_with_sklearn.py

* Fix lint
2019-01-31 11:29:19 -08:00
Jiaming Yuan
4fac9874e0
Check booster for dart in feature importance. (#4073)
* Check booster for dart in feature importance.
2019-01-22 16:03:54 +08:00
Jiaming Yuan
e0a279114e
Unify logging facilities. (#3982)
* Unify logging facilities.

* Enhance `ConsoleLogger` to handle different verbosity.
* Override macros from `dmlc`.
* Don't use specialized gamma when building with GPU.
* Remove verbosity cache in monitor.
* Test monitor.
* Deprecate `silent`.
* Fix doc and messages.
* Fix python test.
* Fix silent tests.
2018-12-14 19:29:58 +08:00
Sam Wilkinson
fd722d60cd Deprecation warning for lists passed into DMatrix (#3970)
* Ensure lists cannot be passed into DMatrix

The documentation does not include lists as an allowed type for the data inputted into DMatrix. Despite this, a list can be passed in without an error. This change would prevent a list form being passed in directly.
2018-12-14 19:26:11 +08:00
lyxthe
53f695acf2 scikit-learn api section documentation correction (#3967)
* update description of early stopping rounds

the description of early stopping round was quite inconsistent in the scikit-learn api section since the fit paragraph tells that when early stopping rounds occurs, the last iteration is returned not the best one, but the predict paragraph tells that when the predict is called without ntree_limit specified, then ntree_limit is equals to best_ntree_limit.

Thus, when reading the fit part, one could think that it is needed to specify what is the best iter when calling the predict, but when reading the predict part, then the best iter is given by default, it is the last iter that you have to specify if needed.

* Update sklearn.py

* Update sklearn.py

fix doc according to the python_lightweight_test error
2018-12-14 00:27:04 -08:00
Philip Hyunsu Cho
c5130e487a
Fix #3894: Allow loading pickles without self.booster attributes (redux) (#3944) 2018-11-28 09:31:46 -08:00
Philip Hyunsu Cho
f9302a56fb
Fix #3894: Allow loading pickles without self.booster attributes (#3938)
The addition of self.booster attribute broke backward compatibility.
2018-11-23 12:15:50 -08:00
Philip Hyunsu Cho
7d3149a21f
Add AUC-PR to list of metrics to maximize for early stopping (#3936) 2018-11-23 12:15:34 -08:00
Jiaming Yuan
93f63324e6
Address deprecation of Python ABC. (#3909) 2018-11-16 19:43:32 +13:00
Joey Gao
0cd326c1bc Add parameter to make node type configurable in plot tree (#3859)
* add parameters 'conditionNodeParams' and 'leafNodeParams' to function `to_graphviz` enable to configure node type
2018-11-16 17:29:37 +13:00
Philip Hyunsu Cho
c76d993681
Enforce naming style in Python lint (#3896) 2018-11-14 10:35:25 -08:00
Dr. Kashif Rasul
143475b27b use gain for sklearn feature_importances_ (#3876)
* use gain for sklearn feature_importances_

`gain` is a better feature importance criteria than the currently used `weight`

* added importance_type to class

* fixed test

* white space

* fix variable name

* fix deprecation warning

* fix exp array

* white spaces
2018-11-13 03:30:40 -08:00
Philip Hyunsu Cho
ad6e0d55f1
Fix coef_ and intercept_ signature to be compatible with sklearn.RFECV (#3873)
* Fix coef_ and intercept_ signature to be compatible with sklearn.RFECV

* Fix lint

* Fix lint
2018-11-08 19:41:35 -08:00
Jelle Zijlstra
d9642cf757 handle $PATH not being set in python library (#3845)
Fixes #3844
2018-11-06 15:27:02 -08:00
Nikita Titov
1bf4083dc6 open README with utf-8 and add gcc-8 (#3867) 2018-11-06 14:53:33 -08:00
Philip Hyunsu Cho
78ec77fa97
Release 0.81 version (#3864)
* Release 0.81 version

* Update NEWS.md
2018-11-04 05:49:11 -08:00
Philip Hyunsu Cho
e04ab56b57
Fix #3747: Add coef_ and intercept_ as properties of sklearn wrapper (#3855)
* Fix #3747: Add coef_ and intercept_ as properties of sklearn wrapper

Scikit-learn expects linear learners to expose `coef_` and `intercept_`
as properties.

Closes #3747.

* Fix lint
2018-11-02 01:44:37 -07:00
Rory Mitchell
42200ec03e
Allow XGBRanker sklearn interface to use other xgboost ranking objectives (#3848) 2018-11-01 13:34:25 +13:00