Skip to content

Commit

Permalink
Add docs for passThroughArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
svotaw committed Nov 30, 2022
1 parent 2d06b94 commit b00e953
Show file tree
Hide file tree
Showing 5 changed files with 170 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import org.apache.spark.ml.util.DefaultParamsWritable
trait LightGBMExecutionParams extends Wrappable {
val passThroughArgs = new Param[String](this, "passThroughArgs",
"Direct string to pass through to LightGBM library (appended with other explicitly set params). " +
"Will override any parameters given with explicit setters. Can include multiple parameters in one string.")
"Will override any parameters given with explicit setters. Can include multiple parameters in one string. " +
"e.g., force_row_wise=true")
setDefault(passThroughArgs->"")
def getPassThroughArgs: String = $(passThroughArgs)
def setPassThroughArgs(value: String): this.type = set(passThroughArgs, value)
Expand Down
42 changes: 42 additions & 0 deletions website/docs/features/lightgbm/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,48 @@ model = LightGBMRegressor(application='quantile',
For an end to end application, check out the LightGBM [notebook
example](../LightGBM%20-%20Overview).

### Arguments

SynapseML exposes getters/setters for many common LightGBM parameters.
In python, you can use the properties as shown above, or in Scala use the
fluent setters.
```scala
import com.microsoft.azure.synapse.ml.lightgbm.LightGBMClassifier
val classifier = new LightGBMClassifier()
.setLearningRate(0.2)
.setNumLeaves(50)
```

LightGBM has far more parameters than SynapseML exposes. For cases where you
need to set some parameters that SyanpseML does not expose a setter for, use
passThroughArgs. This is just a free string that you can use to add extra parameters
to the command SynapseML sends to configure LightGBM.

```python
from synapse.ml.lightgbm import LightGBMClassifier
model = LightGBMClassifier(passThroughArgs="force_row_wise=true",
numIterations=100,
numLeaves=31).fit(train)
```

```scala
import com.microsoft.azure.synapse.ml.lightgbm.LightGBMClassifier
val classifier = new LightGBMClassifier()
.setPassThroughArgs("force_row_wise=true min_sum_hessian_in_leaf=2e-3")
.setLearningRate(0.2)
.setNumLeaves(50)
```

For formatting options and specific argument documentation, see
[LightGBM docs](https://lightgbm.readthedocs.io/en/v3.3.2/Parameters.html). Some
parameters SynapseML will set specifically for the Spark distributed environment and
should not be changed. Some parameters are for cli mode only, and will not work within
Spark.

Note that you can mix passThroughArgs and explicit args, as shown above. SynapseML will
merge them to create one argument string to send to LightGBM. If you set a parameter in
both places, the passThroughArgs will take precedence.

### Architecture

LightGBM on Spark uses the Simple Wrapper and Interface Generator (SWIG)
Expand Down
42 changes: 42 additions & 0 deletions website/versioned_docs/version-0.10.0/features/lightgbm/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,48 @@ model = LightGBMRegressor(application='quantile',
For an end to end application, check out the LightGBM [notebook
example](../LightGBM%20-%20Overview).

### Arguments

SynapseML exposes getters/setters for many common LightGBM parameters.
In python, you can use the properties as shown above, or in Scala use the
fluent setters.
```scala
import com.microsoft.azure.synapse.ml.lightgbm.LightGBMClassifier
val classifier = new LightGBMClassifier()
.setLearningRate(0.2)
.setNumLeaves(50)
```

LightGBM has far more parameters than SynapseML exposes. For cases where you
need to set some parameters that SyanpseML does not expose a setter for, use
passThroughArgs. This is just a free string that you can use to add extra parameters
to the command SynapseML sends to configure LightGBM.

```python
from synapse.ml.lightgbm import LightGBMClassifier
model = LightGBMClassifier(passThroughArgs="force_row_wise=true",
numIterations=100,
numLeaves=31).fit(train)
```

```scala
import com.microsoft.azure.synapse.ml.lightgbm.LightGBMClassifier
val classifier = new LightGBMClassifier()
.setPassThroughArgs("force_row_wise=true min_sum_hessian_in_leaf=2e-3")
.setLearningRate(0.2)
.setNumLeaves(50)
```

For formatting options and specific argument documentation, see
[LightGBM docs](https://lightgbm.readthedocs.io/en/v3.3.2/Parameters.html). Some
parameters SynapseML will set specifically for the Spark distributed environment and
should not be changed. Some parameters are for cli mode only, and will not work within
Spark.

Note that you can mix passThroughArgs and explicit args, as shown above. SynapseML will
merge them to create one argument string to send to LightGBM. If you set a parameter in
both places, the passThroughArgs will take precedence.

### Architecture

LightGBM on Spark uses the Simple Wrapper and Interface Generator (SWIG)
Expand Down
42 changes: 42 additions & 0 deletions website/versioned_docs/version-0.10.1/features/lightgbm/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,48 @@ model = LightGBMRegressor(application='quantile',
For an end to end application, check out the LightGBM [notebook
example](../LightGBM%20-%20Overview).

### Arguments

SynapseML exposes getters/setters for many common LightGBM parameters.
In python, you can use the properties as shown above, or in Scala use the
fluent setters.
```scala
import com.microsoft.azure.synapse.ml.lightgbm.LightGBMClassifier
val classifier = new LightGBMClassifier()
.setLearningRate(0.2)
.setNumLeaves(50)
```

LightGBM has far more parameters than SynapseML exposes. For cases where you
need to set some parameters that SyanpseML does not expose a setter for, use
passThroughArgs. This is just a free string that you can use to add extra parameters
to the command SynapseML sends to configure LightGBM.

```python
from synapse.ml.lightgbm import LightGBMClassifier
model = LightGBMClassifier(passThroughArgs="force_row_wise=true",
numIterations=100,
numLeaves=31).fit(train)
```

```scala
import com.microsoft.azure.synapse.ml.lightgbm.LightGBMClassifier
val classifier = new LightGBMClassifier()
.setPassThroughArgs("force_row_wise=true min_sum_hessian_in_leaf=2e-3")
.setLearningRate(0.2)
.setNumLeaves(50)
```

For formatting options and specific argument documentation, see
[LightGBM docs](https://lightgbm.readthedocs.io/en/v3.3.2/Parameters.html). Some
parameters SynapseML will set specifically for the Spark distributed environment and
should not be changed. Some parameters are for cli mode only, and will not work within
Spark.

Note that you can mix passThroughArgs and explicit args, as shown above. SynapseML will
merge them to create one argument string to send to LightGBM. If you set a parameter in
both places, the passThroughArgs will take precedence.

### Architecture

LightGBM on Spark uses the Simple Wrapper and Interface Generator (SWIG)
Expand Down
42 changes: 42 additions & 0 deletions website/versioned_docs/version-0.10.2/features/lightgbm/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,48 @@ model = LightGBMRegressor(application='quantile',
For an end to end application, check out the LightGBM [notebook
example](../LightGBM%20-%20Overview).

### Arguments

SynapseML exposes getters/setters for many common LightGBM parameters.
In python, you can use the properties as shown above, or in Scala use the
fluent setters.
```scala
import com.microsoft.azure.synapse.ml.lightgbm.LightGBMClassifier
val classifier = new LightGBMClassifier()
.setLearningRate(0.2)
.setNumLeaves(50)
```

LightGBM has far more parameters than SynapseML exposes. For cases where you
need to set some parameters that SyanpseML does not expose a setter for, use
passThroughArgs. This is just a free string that you can use to add extra parameters
to the command SynapseML sends to configure LightGBM.

```python
from synapse.ml.lightgbm import LightGBMClassifier
model = LightGBMClassifier(passThroughArgs="force_row_wise=true",
numIterations=100,
numLeaves=31).fit(train)
```

```scala
import com.microsoft.azure.synapse.ml.lightgbm.LightGBMClassifier
val classifier = new LightGBMClassifier()
.setPassThroughArgs("force_row_wise=true min_sum_hessian_in_leaf=2e-3")
.setLearningRate(0.2)
.setNumLeaves(50)
```

For formatting options and specific argument documentation, see
[LightGBM docs](https://lightgbm.readthedocs.io/en/v3.3.2/Parameters.html). Some
parameters SynapseML will set specifically for the Spark distributed environment and
should not be changed. Some parameters are for cli mode only, and will not work within
Spark.

Note that you can mix passThroughArgs and explicit args, as shown above. SynapseML will
merge them to create one argument string to send to LightGBM. If you set a parameter in
both places, the passThroughArgs will take precedence.

### Architecture

LightGBM on Spark uses the Simple Wrapper and Interface Generator (SWIG)
Expand Down

0 comments on commit b00e953

Please sign in to comment.