Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add docs for passThroughArgs #1749

Merged
merged 4 commits into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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",
svotaw marked this conversation as resolved.
Show resolved Hide resolved
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
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