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']}}
Currently `pip install xgboost` will raise traceback like this
```
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-IAdqYE/xgboost/setup.py", line 20, in <module>
import xgboost
File "./xgboost/__init__.py", line 8, in <module>
from .core import DMatrix, Booster
File "./xgboost/core.py", line 12, in <module>
import numpy as np
ImportError: No module named numpy
```
We should avoid importing numpy in setup.py and let pip install numpy and scipy automatically.
That's what `install_requires` for.