Skip to content

Commit c6e97e6

Browse files
authored
merge pr #718: document elastic net regularization via mixture
2 parents fd7cb6a + 81838e1 commit c6e97e6

24 files changed

+145
-73
lines changed

R/linear_reg.R

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@
1717
#' model is `"lm"`.
1818
#' @param penalty A non-negative number representing the total
1919
#' amount of regularization (specific engines only).
20-
#' @param mixture A number between zero and one (inclusive) that is the
21-
#' proportion of L1 regularization (i.e. lasso) in the model. When
22-
#' `mixture = 1`, it is a pure lasso model while `mixture = 0` indicates that
23-
#' ridge regression is being used (specific engines only).
20+
#' @param mixture A number between zero and one (inclusive) denoting the
21+
#' proportion of L1 regularization (i.e. lasso) in the model.
22+
#'
23+
#' * `mixture = 1` specifies a pure lasso model,
24+
#' * `mixture = 0` specifies a ridge regression model, and
25+
#' * `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
26+
#'
27+
#' Available for specific engines only.
2428
#'
2529
#' @template spec-details
2630
#'

R/logistic_reg.R

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@
2020
#' For `keras` models, this corresponds to purely L2 regularization
2121
#' (aka weight decay) while the other models can be either or a combination
2222
#' of L1 and L2 (depending on the value of `mixture`).
23-
#' @param mixture A number between zero and one (inclusive) that is the
24-
#' proportion of L1 regularization (i.e. lasso) in the model. When
25-
#' `mixture = 1`, it is a pure lasso model while `mixture = 0` indicates that
26-
#' ridge regression is being used. (specific engines only).
27-
#' For `LiblineaR` models, `mixture` must be exactly 0 or 1 only.
23+
#' @param mixture A number between zero and one (inclusive) giving the
24+
#' proportion of L1 regularization (i.e. lasso) in the model.
25+
#'
26+
#' * `mixture = 1` specifies a pure lasso model,
27+
#' * `mixture = 0` specifies a ridge regression model, and
28+
#' * `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
29+
#'
30+
#' Available for specific engines only. For `LiblineaR` models, `mixture` must
31+
#' be exactly 1 or 0 only.
2832
#'
2933
#' @template spec-details
3034
#'

R/multinom_reg.R

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@
2121
#' For `keras` models, this corresponds to purely L2 regularization
2222
#' (aka weight decay) while the other models can be a combination
2323
#' of L1 and L2 (depending on the value of `mixture`).
24-
#' @param mixture A number between zero and one (inclusive) that is the
25-
#' proportion of L1 regularization (i.e. lasso) in the model. When
26-
#' `mixture = 1`, it is a pure lasso model while `mixture = 0` indicates that
27-
#' ridge regression is being used. (specific engines only).
24+
#' @param mixture A number between zero and one (inclusive) giving the
25+
#' proportion of L1 regularization (i.e. lasso) in the model.
26+
#'
27+
#' * `mixture = 1` specifies a pure lasso model,
28+
#' * `mixture = 0` specifies a ridge regression model, and
29+
#' * `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
30+
#'
31+
#' Available for specific engines only.
2832
#'
2933
#' @template spec-details
3034
#'

R/poisson_reg.R

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@
1515
#' The only possible value for this model is "regression".
1616
#' @param penalty A non-negative number representing the total
1717
#' amount of regularization (`glmnet` only).
18-
#' @param mixture A number between zero and one (inclusive) that is the
19-
#' proportion of L1 regularization (i.e. lasso) in the model. When
20-
#' `mixture = 1`, it is a pure lasso model while `mixture = 0` indicates that
21-
#' ridge regression is being used. (`glmnet` and `spark` only).
18+
#' @param mixture A number between zero and one (inclusive) giving the
19+
#' proportion of L1 regularization (i.e. lasso) in the model.
20+
#'
21+
#' * `mixture = 1` specifies a pure lasso model,
22+
#' * `mixture = 0` specifies a ridge regression model, and
23+
#' * `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
24+
#'
25+
#' Available for `glmnet` and `spark` only.
2226
#'
2327
#' @template spec-details
2428
#'

man/linear_reg.Rd

Lines changed: 9 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/logistic_reg.Rd

Lines changed: 10 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/multinom_reg.Rd

Lines changed: 9 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/parsnip_update.Rd

Lines changed: 10 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/poisson_reg.Rd

Lines changed: 9 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/proportional_hazards.Rd

Lines changed: 9 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/rmd/linear_reg_spark.Rmd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ This model has `r nrow(param)` tuning parameters:
2222
param$item
2323
```
2424

25-
For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay).
25+
For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay). As for `mixture`:
2626

27-
A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
27+
* `mixture = 1` specifies a pure lasso model,
28+
* `mixture = 0` specifies a ridge regression model, and
29+
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
2830

2931
## Translation from parsnip to the original package
3032

man/rmd/linear_reg_spark.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ This model has 2 tuning parameters:
1313

1414
- `mixture`: Proportion of Lasso Penalty (type: double, default: 0.0)
1515

16-
For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay).
16+
For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay). As for `mixture`:
1717

18-
A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
18+
* `mixture = 1` specifies a pure lasso model,
19+
* `mixture = 0` specifies a ridge regression model, and
20+
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
1921

2022
## Translation from parsnip to the original package
2123

man/rmd/logistic_reg_glmnet.Rmd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ This model has `r nrow(param)` tuning parameters:
2222
param$item
2323
```
2424

25-
A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
25+
The `penalty` parameter has no default and requires a single numeric value. For more details about this, and the `glmnet` model in general, see [glmnet-details]. As for `mixture`:
2626

27-
The `penalty` parameter has no default and requires a single numeric value. For more details about this, and the `glmnet` model in general, see [glmnet-details].
27+
* `mixture = 1` specifies a pure lasso model,
28+
* `mixture = 0` specifies a ridge regression model, and
29+
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
2830

2931
## Translation from parsnip to the original package
3032

man/rmd/logistic_reg_glmnet.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ This model has 2 tuning parameters:
1313

1414
- `mixture`: Proportion of Lasso Penalty (type: double, default: 1.0)
1515

16-
A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
16+
The `penalty` parameter has no default and requires a single numeric value. For more details about this, and the `glmnet` model in general, see [glmnet-details]. As for `mixture`:
1717

18-
The `penalty` parameter has no default and requires a single numeric value. For more details about this, and the `glmnet` model in general, see [glmnet-details].
18+
* `mixture = 1` specifies a pure lasso model,
19+
* `mixture = 0` specifies a ridge regression model, and
20+
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
1921

2022
## Translation from parsnip to the original package
2123

man/rmd/logistic_reg_spark.Rmd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ This model has `r nrow(param)` tuning parameters:
2222
param$item
2323
```
2424

25-
For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay).
25+
For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay). As for `mixture`:
2626

27-
A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
27+
* `mixture = 1` specifies a pure lasso model,
28+
* `mixture = 0` specifies a ridge regression model, and
29+
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
2830

2931
## Translation from parsnip to the original package
3032

man/rmd/logistic_reg_spark.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ This model has 2 tuning parameters:
1313

1414
- `mixture`: Proportion of Lasso Penalty (type: double, default: 0.0)
1515

16-
For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay).
16+
For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay). As for `mixture`:
1717

18-
A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
18+
* `mixture = 1` specifies a pure lasso model,
19+
* `mixture = 0` specifies a ridge regression model, and
20+
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
1921

2022
## Translation from parsnip to the original package
2123

man/rmd/multinom_reg_glmnet.Rmd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ This model has `r nrow(param)` tuning parameters:
2222
param$item
2323
```
2424

25-
A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
25+
The `penalty` parameter has no default and requires a single numeric value. For more details about this, and the `glmnet` model in general, see [glmnet-details]. As for `mixture`:
2626

27-
The `penalty` parameter has no default and requires a single numeric value. For more details about this, and the `glmnet` model in general, see [glmnet-details].
27+
* `mixture = 1` specifies a pure lasso model,
28+
* `mixture = 0` specifies a ridge regression model, and
29+
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
2830

2931
## Translation from parsnip to the original package
3032

man/rmd/multinom_reg_glmnet.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ This model has 2 tuning parameters:
1313

1414
- `mixture`: Proportion of Lasso Penalty (type: double, default: 1.0)
1515

16-
A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
16+
The `penalty` parameter has no default and requires a single numeric value. For more details about this, and the `glmnet` model in general, see [glmnet-details]. As for `mixture`:
1717

18-
The `penalty` parameter has no default and requires a single numeric value. For more details about this, and the `glmnet` model in general, see [glmnet-details].
18+
* `mixture = 1` specifies a pure lasso model,
19+
* `mixture = 0` specifies a ridge regression model, and
20+
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
1921

2022
## Translation from parsnip to the original package
2123

man/rmd/multinom_reg_spark.Rmd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ This model has `r nrow(param)` tuning parameters:
2222
param$item
2323
```
2424

25-
For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay).
25+
For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay). As for `mixture`:
2626

27-
A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
27+
* `mixture = 1` specifies a pure lasso model,
28+
* `mixture = 0` specifies a ridge regression model, and
29+
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
2830

2931
## Translation from parsnip to the original package
3032

man/rmd/multinom_reg_spark.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ This model has 2 tuning parameters:
1313

1414
- `mixture`: Proportion of Lasso Penalty (type: double, default: 0.0)
1515

16-
For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay).
16+
For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay). As for `mixture`:
1717

18-
A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
18+
* `mixture = 1` specifies a pure lasso model,
19+
* `mixture = 0` specifies a ridge regression model, and
20+
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
1921

2022
## Translation from parsnip to the original package
2123

man/rmd/poisson_reg_glmnet.Rmd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ This model has `r nrow(param)` tuning parameters:
2222
param$item
2323
```
2424

25-
A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
25+
The `penalty` parameter has no default and requires a single numeric value. For more details about this, and the `glmnet` model in general, see [glmnet-details]. As for `mixture`:
2626

27-
The `penalty` parameter has no default and requires a single numeric value. For more details about this, and the `glmnet` model in general, see [glmnet-details].
27+
* `mixture = 1` specifies a pure lasso model,
28+
* `mixture = 0` specifies a ridge regression model, and
29+
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
2830

2931
## Translation from parsnip to the original package
3032

man/rmd/poisson_reg_glmnet.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ This model has 2 tuning parameters:
1313

1414
- `mixture`: Proportion of Lasso Penalty (type: double, default: 1.0)
1515

16-
A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
16+
The `penalty` parameter has no default and requires a single numeric value. For more details about this, and the `glmnet` model in general, see [glmnet-details]. As for `mixture`:
1717

18-
The `penalty` parameter has no default and requires a single numeric value. For more details about this, and the `glmnet` model in general, see [glmnet-details].
18+
* `mixture = 1` specifies a pure lasso model,
19+
* `mixture = 0` specifies a ridge regression model, and
20+
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
1921

2022
## Translation from parsnip to the original package
2123

0 commit comments

Comments
 (0)