Unverified Commit 0e3906aa authored by xuehui's avatar xuehui Committed by GitHub
Browse files

update gbdt docs (#1720)

parent 9dec51e2
...@@ -44,7 +44,15 @@ Given the features and label in train data, we train a GBDT regression model and ...@@ -44,7 +44,15 @@ Given the features and label in train data, we train a GBDT regression model and
## 3. How to run in nni ## 3. How to run in nni
### 3.1 Prepare your trial code
### 3.1 Install all the requirments
```
pip install lightgbm
pip install pandas
```
### 3.2 Prepare your trial code
You need to prepare a basic code as following: You need to prepare a basic code as following:
...@@ -86,7 +94,7 @@ if __name__ == '__main__': ...@@ -86,7 +94,7 @@ if __name__ == '__main__':
run(lgb_train, lgb_eval, PARAMS, X_test, y_test) run(lgb_train, lgb_eval, PARAMS, X_test, y_test)
``` ```
### 3.2 Prepare your search space. ### 3.3 Prepare your search space.
If you like to tune `num_leaves`, `learning_rate`, `bagging_fraction` and `bagging_freq`, you could write a [search_space.json](https://github.com/Microsoft/nni/blob/master/examples/trials/auto-gbdt/search_space.json) as follow: If you like to tune `num_leaves`, `learning_rate`, `bagging_fraction` and `bagging_freq`, you could write a [search_space.json](https://github.com/Microsoft/nni/blob/master/examples/trials/auto-gbdt/search_space.json) as follow:
```json ```json
...@@ -100,7 +108,7 @@ If you like to tune `num_leaves`, `learning_rate`, `bagging_fraction` and `baggi ...@@ -100,7 +108,7 @@ If you like to tune `num_leaves`, `learning_rate`, `bagging_fraction` and `baggi
More support variable type you could reference [here](../Tutorial/SearchSpaceSpec.md). More support variable type you could reference [here](../Tutorial/SearchSpaceSpec.md).
### 3.3 Add SDK of nni into your code. ### 3.4 Add SDK of nni into your code.
```diff ```diff
+import nni +import nni
...@@ -146,7 +154,7 @@ if __name__ == '__main__': ...@@ -146,7 +154,7 @@ if __name__ == '__main__':
run(lgb_train, lgb_eval, PARAMS, X_test, y_test) run(lgb_train, lgb_eval, PARAMS, X_test, y_test)
``` ```
### 3.4 Write a config file and run it. ### 3.5 Write a config file and run it.
In the config file, you could set some settings including: In the config file, you could set some settings including:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment