coding style update (#2752)

* coding style update

Current coding style varies(for example: the mixed use of single quote and double quote), and it will be confusing, especially for new users.
This PR will try to follow proposal of PEP8, make the documents more readable.

* minor fix
This commit is contained in:
Icyblade Dai 2017-10-01 05:42:15 -07:00 committed by Yuan (Terry) Tang
parent 4cb2f7598b
commit 6e378452f2

View File

@ -49,7 +49,7 @@ dtrain = xgb.DMatrix(csr)
* Saving ```DMatrix``` into a XGBoost binary file will make loading faster: * Saving ```DMatrix``` into a XGBoost binary file will make loading faster:
```python ```python
dtrain = xgb.DMatrix('train.svm.txt') dtrain = xgb.DMatrix('train.svm.txt')
dtrain.save_binary("train.buffer") dtrain.save_binary('train.buffer')
``` ```
* Missing values can be replaced by a default value in the ```DMatrix``` constructor: * Missing values can be replaced by a default value in the ```DMatrix``` constructor:
```python ```python
@ -106,7 +106,7 @@ bst.dump_model('dump.raw.txt','featmap.txt')
A saved model can be loaded as follows: A saved model can be loaded as follows:
```python ```python
bst = xgb.Booster({'nthread': 4}) # init model bst = xgb.Booster({'nthread': 4}) # init model
bst.load_model("model.bin") # load data bst.load_model('model.bin') # load data
``` ```
Early Stopping Early Stopping