130 Commits

Author SHA1 Message Date
phunterlau
ee4096d23e fix pushd problem of pip building, convert README to rst for PyPI 2015-11-11 23:03:07 -08:00
Yuan (Terry) Tang
7b3fd92015 Added PyPI badges 2015-11-10 18:23:39 -06:00
Far0n
ce5930c365 best_ntree_limit attribute added
- best_ntree_limit as new booster atrribute added
- usage of bst.best_ntree_limit in python doc added
- fixed wrong 'best_iteration' after training continuation
2015-11-10 15:37:22 +01:00
antonymayi
8c7b18daed python 2.6 compatibility tweak
replacing set literal {} with set() for python 2.6 compatibility (plus reformatting the line)
2015-11-10 14:50:54 +01:00
Yuan (Terry) Tang
1dd96b6cdc Merge pull request #597 from JohanManders/python-pandas-dtypes
Python pandas dtypes
2015-11-09 18:08:41 -06:00
antonymayi
7114d6681a Update training.py
pylint compliancy
2015-11-09 15:09:14 +01:00
antonymayi
34e01642ca Update training.py
avoid dict comprehension for python 2.6 compatibility
2015-11-09 14:26:16 +01:00
Yuan (Terry) Tang
b8bc85b534 Clarification for learning_rates 2015-11-08 21:10:04 -06:00
Faron
b2f98db74e grammar correction 2015-11-08 21:00:16 +01:00
Yuan (Terry) Tang
01053f8f2f Merge pull request #594 from Far0n/feval
python: multiple eval_metrics changes
2015-11-08 10:10:28 -05:00
FrozenFingerz
b59018aa05 python: multiple eval_metrics changes
- allows feval to return a list of tuples (name, error/score value)
- changed behavior for multiple eval_metrics in conjunction with
early_stopping: Instead of raising an error, the last passed evel_metric
(or last entry in return value of feval) is used for early stopping
- allows list of eval_metrics in dict-typed params
- unittest for new features / behavior

documentation updated

- example for assigning a list to 'eval_metric'
- note about early stopping on last passed eval metric

- info msg for used eval metric added
2015-11-08 11:23:54 +01:00
Faron
95cc900b1f early stopping for CV (python) 2015-11-07 09:52:36 +01:00
Johan Manders
5f0f8749d9 Cleaned up some code 2015-11-04 18:05:47 +01:00
Johan Manders
f9e1b2b7b7 Added back feature names 2015-11-03 21:26:11 +01:00
Johan Manders
96f221e0d0 Merge pull request #5 from dmlc/master
Update to latest version
2015-11-03 20:37:20 +01:00
Far0n
b894f7c9d6 bugfix type-check xgb_model param 2015-11-03 14:43:08 +01:00
Faron
4fe2f2fb09 python train additions
+ training continuation of existing model
+ maximize parameter just like in R package (whether  to maximize feval)
2015-11-02 21:21:05 +01:00
Faron
79813097b5 sklearn_wrapper additions
added output_margin & ntree_limit to predict and predict_proba
2015-11-02 17:41:30 +01:00
phunterlau
739b3f2c5f separate setup.py with pip installation, add trouble shooting page 2015-11-01 22:11:11 -08:00
terrytangyuan
610b70b79e Suppress more evaluation verbose during training 2015-10-31 13:05:52 -04:00
terrytangyuan
15a0d27eed Fixed bug in eta decay (+2 squashed commits)
Squashed commits:
[b67caf2] Fix build
[365ceaa] Fixed bug in eta decay
2015-10-31 12:54:27 -04:00
Yuan (Terry) Tang
c16a6222f3 Merge pull request #563 from Far0n/eta_decay
learning_rates per boosting round
2015-10-30 10:21:33 -05:00
Tianqi Chen
3e648fd1e9 Merge pull request #572 from ghosthugger/master
install xgboost so it can be imported
2015-10-29 10:59:28 -07:00
Preston Parry
b3bb54da73 fixes typo in error message 2015-10-27 23:34:50 -07:00
Gösta Forsum
111b04e18e Update setup.py 2015-10-27 13:47:58 +01:00
Faron
738e420128 correcting wrong default values 2015-10-25 11:26:33 +01:00
Faron
b80d5d6b33 fixed too long lines 2015-10-25 11:17:35 +01:00
Faron
422febd18e added missing params 2015-10-25 10:58:07 +01:00
Faron
68c9252ff7 fixed "Exactly one space required after comma" 2015-10-25 10:20:00 +01:00
Faron
a1ba608641 learning_rates per boosting round 2015-10-25 10:00:20 +01:00
Tianqi Chen
06f502a1aa Merge pull request #549 from phunterlau/master
Fix data file shipping confusions on pip install for #463
2015-10-24 22:08:59 -07:00
sinhrks
1f19b78287 Python: adjusts plot_importance ylim 2015-10-25 03:16:53 +09:00
Takahisa Shimoda
607599f2a1 fix sklearn.py for evals_result in python3 2015-10-23 05:40:31 +09:00
Takahisa Shimoda
b587dd2704 fix training.py for evals_result in python3 2015-10-23 05:37:13 +09:00
phunterlau
24a92808db correct print for python 3 2015-10-21 14:32:35 -07:00
sinhrks
6f046327ac Allow plot function to handle XGBModel 2015-10-22 01:00:54 +09:00
Johan Manders
7c79c9ac3a Bool gets mapped to i instead of int 2015-10-19 17:36:57 +02:00
phunterlau
8ad58139cd fix pylint warnings 2015-10-18 18:55:15 -07:00
phunterlau
7b25834667 fix data file shipping confusions, force system compiling, correct libpath for pip 2015-10-18 17:28:07 -07:00
Johan Manders
9bbc3901ee More Pandas dtypes and more flexible variable naming
- Pandas DataFrame supports more dtypes than 'int64', 'float64' and 'bool', therefor added a bunch of extra dtypes for the data variable.
- From now on the label variable can be a Pandas DataFrame with the same dtypes as the data variable.
- If label is a Pandas DataFrame will be converted to float.
- If no feature_types is set, the data dtypes will be converted to 'int' or 'float'.
- The feature_names may contain every character except [, ] or <
2015-10-17 15:13:42 +02:00
Johan Manders
00387cb645 Removed th last few trailing whitespaces 2015-10-14 14:26:18 +02:00
Johan Manders
0f8f8e05b2 One line was too long 2015-10-14 14:18:31 +02:00
Johan Manders
82c2ba4c44 Removed trailing whitespaces and Change Error to XGBoostError 2015-10-14 14:17:57 +02:00
Johan Manders
9c8420a4dc Updated the documentation a bit
Will upload some demos for guide-python later.
2015-10-14 12:53:42 +02:00
Johan Manders
e960a09ff4 Made eval_results for sklearn output the same structure as in the new training.py
Changed the name of eval_results to evals_result, so that the naming is the same in training.py and sklearn.py

Made the structure of evals_result the same as in training.py, the names of the keys are different:

In sklearn.py you cannot name your evals_result, but they are automatically called 'validation_0', 'validation_1' etc.
The dict evals_result will output something like: {'validation_0': {'logloss': ['0.674800', '0.657121']}, 'validation_1': {'logloss': ['0.63776', '0.58372']}}

In training.py you can name your multiple evals_result with a watchlist like: watchlist  = [(dtest,'eval'), (dtrain,'train')]
The dict evals_result will output something like: {'train': {'logloss': ['0.68495', '0.67691']}, 'eval': {'logloss': ['0.684877', '0.676767']}}

You can access the evals_result using the evals_result() function.
2015-10-14 12:51:46 +02:00
Johan Manders
e339cdec52 Too many branches and unused key 2015-10-12 16:47:24 +02:00
Johan Manders
40566cdbba update sklearn.py because evals_result in training.py changed
Because I changed the training.py, the sklearn.py had to be changed also to be able to read all the data form evals_result.
2015-10-12 16:31:23 +02:00
quansie
b758a13813 Removed extra spaces 2015-10-12 14:26:23 +02:00
quansie
1ca737ed55 Update training.py
Made changes to training.py to make sure all eval_metric information get passed to evals_result. Previous version lost and mislabeled data in evals_result when using more than one eval_metric.

Structure of eval_metric is now:
eval_metric[evals][eval_metric] = list of metrics

Example:

>>> dtrain = xgb.DMatrix('agaricus.txt.train', silent=True)
>>> dtest = xgb.DMatrix('agaricus.txt.test', silent=True)

>>> param = [('max_depth', 2), ('objective', 'binary:logistic'), ('bst:eta', 0.01), ('eval_metric', 'logloss'), ('eval_metric', 'error')]

>>> watchlist  = [(dtest,'eval'), (dtrain,'train')]
>>> num_round = 3
>>> evals_result = {}
>>> bst = xgb.train(param, dtrain, num_round, watchlist, evals_result=evals_result)

>>> print(evals_result['eval']['logloss'])
>>> print(evals_result)

Prints:

['0.684877', '0.676767', '0.668817']

{'train': {'logloss': ['0.684954', '0.676917', '0.669036'], 'error': ['0.04652', '0.04652', '0.04652']}, 'eval': {'logloss': ['0.684877', '0.676767', '0.668817'], 'error': ['0.042831', '0.042831', '0.042831']}}
2015-10-11 01:09:05 +02:00
sinhrks
dbcb4c8729 Support non-str column names 2015-10-04 13:30:01 +09:00