Skip to content

document elastic net regularization via mixture #718

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

Merged
merged 2 commits into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 8 additions & 4 deletions R/linear_reg.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@
#' model is `"lm"`.
#' @param penalty A non-negative number representing the total
#' amount of regularization (specific engines only).
#' @param mixture A number between zero and one (inclusive) that is the
#' proportion of L1 regularization (i.e. lasso) in the model. When
#' `mixture = 1`, it is a pure lasso model while `mixture = 0` indicates that
#' ridge regression is being used (specific engines only).
#' @param mixture A number between zero and one (inclusive) denoting the
#' proportion of L1 regularization (i.e. lasso) in the model.
#'
#' * `mixture = 1` specifies a pure lasso model,
#' * `mixture = 0` specifies a ridge regression model, and
#' * `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
#'
#' Available for specific engines only.
#'
#' @template spec-details
#'
Expand Down
14 changes: 9 additions & 5 deletions R/logistic_reg.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@
#' For `keras` models, this corresponds to purely L2 regularization
#' (aka weight decay) while the other models can be either or a combination
#' of L1 and L2 (depending on the value of `mixture`).
#' @param mixture A number between zero and one (inclusive) that is the
#' proportion of L1 regularization (i.e. lasso) in the model. When
#' `mixture = 1`, it is a pure lasso model while `mixture = 0` indicates that
#' ridge regression is being used. (specific engines only).
#' For `LiblineaR` models, `mixture` must be exactly 0 or 1 only.
#' @param mixture A number between zero and one (inclusive) giving the
#' proportion of L1 regularization (i.e. lasso) in the model.
#'
#' * `mixture = 1` specifies a pure lasso model,
#' * `mixture = 0` specifies a ridge regression model, and
#' * `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
#'
#' Available for specific engines only. For `LiblineaR` models, `mixture` must
#' be exactly 1 or 0 only.
#'
#' @template spec-details
#'
Expand Down
12 changes: 8 additions & 4 deletions R/multinom_reg.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@
#' For `keras` models, this corresponds to purely L2 regularization
#' (aka weight decay) while the other models can be a combination
#' of L1 and L2 (depending on the value of `mixture`).
#' @param mixture A number between zero and one (inclusive) that is the
#' proportion of L1 regularization (i.e. lasso) in the model. When
#' `mixture = 1`, it is a pure lasso model while `mixture = 0` indicates that
#' ridge regression is being used. (specific engines only).
#' @param mixture A number between zero and one (inclusive) giving the
#' proportion of L1 regularization (i.e. lasso) in the model.
#'
#' * `mixture = 1` specifies a pure lasso model,
#' * `mixture = 0` specifies a ridge regression model, and
#' * `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
#'
#' Available for specific engines only.
#'
#' @template spec-details
#'
Expand Down
12 changes: 8 additions & 4 deletions R/poisson_reg.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@
#' The only possible value for this model is "regression".
#' @param penalty A non-negative number representing the total
#' amount of regularization (`glmnet` only).
#' @param mixture A number between zero and one (inclusive) that is the
#' proportion of L1 regularization (i.e. lasso) in the model. When
#' `mixture = 1`, it is a pure lasso model while `mixture = 0` indicates that
#' ridge regression is being used. (`glmnet` and `spark` only).
#' @param mixture A number between zero and one (inclusive) giving the
#' proportion of L1 regularization (i.e. lasso) in the model.
#'
#' * `mixture = 1` specifies a pure lasso model,
#' * `mixture = 0` specifies a ridge regression model, and
#' * `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.
#'
#' Available for `glmnet` and `spark` only.
#'
#' @template spec-details
#'
Expand Down
13 changes: 9 additions & 4 deletions man/linear_reg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions man/logistic_reg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions man/multinom_reg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 10 additions & 7 deletions man/parsnip_update.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions man/poisson_reg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions man/proportional_hazards.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/rmd/linear_reg_spark.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ This model has `r nrow(param)` tuning parameters:
param$item
```

For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay).
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`:

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

## Translation from parsnip to the original package

Expand Down
6 changes: 4 additions & 2 deletions man/rmd/linear_reg_spark.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ This model has 2 tuning parameters:

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

For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay).
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`:

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

## Translation from parsnip to the original package

Expand Down
6 changes: 4 additions & 2 deletions man/rmd/logistic_reg_glmnet.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ This model has `r nrow(param)` tuning parameters:
param$item
```

A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
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`:

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].
* `mixture = 1` specifies a pure lasso model,
* `mixture = 0` specifies a ridge regression model, and
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.

## Translation from parsnip to the original package

Expand Down
6 changes: 4 additions & 2 deletions man/rmd/logistic_reg_glmnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ This model has 2 tuning parameters:

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

A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
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`:

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].
* `mixture = 1` specifies a pure lasso model,
* `mixture = 0` specifies a ridge regression model, and
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.

## Translation from parsnip to the original package

Expand Down
6 changes: 4 additions & 2 deletions man/rmd/logistic_reg_spark.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ This model has `r nrow(param)` tuning parameters:
param$item
```

For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay).
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`:

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

## Translation from parsnip to the original package

Expand Down
6 changes: 4 additions & 2 deletions man/rmd/logistic_reg_spark.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ This model has 2 tuning parameters:

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

For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay).
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`:

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

## Translation from parsnip to the original package

Expand Down
6 changes: 4 additions & 2 deletions man/rmd/multinom_reg_glmnet.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ This model has `r nrow(param)` tuning parameters:
param$item
```

A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
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`:

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].
* `mixture = 1` specifies a pure lasso model,
* `mixture = 0` specifies a ridge regression model, and
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.

## Translation from parsnip to the original package

Expand Down
6 changes: 4 additions & 2 deletions man/rmd/multinom_reg_glmnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ This model has 2 tuning parameters:

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

A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
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`:

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].
* `mixture = 1` specifies a pure lasso model,
* `mixture = 0` specifies a ridge regression model, and
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.

## Translation from parsnip to the original package

Expand Down
6 changes: 4 additions & 2 deletions man/rmd/multinom_reg_spark.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ This model has `r nrow(param)` tuning parameters:
param$item
```

For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay).
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`:

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

## Translation from parsnip to the original package

Expand Down
6 changes: 4 additions & 2 deletions man/rmd/multinom_reg_spark.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ This model has 2 tuning parameters:

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

For `penalty`, the amount of regularization includes both the L1 penalty (i.e., lasso) and the L2 penalty (i.e., ridge or weight decay).
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`:

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

## Translation from parsnip to the original package

Expand Down
6 changes: 4 additions & 2 deletions man/rmd/poisson_reg_glmnet.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ This model has `r nrow(param)` tuning parameters:
param$item
```

A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
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`:

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].
* `mixture = 1` specifies a pure lasso model,
* `mixture = 0` specifies a ridge regression model, and
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.

## Translation from parsnip to the original package

Expand Down
6 changes: 4 additions & 2 deletions man/rmd/poisson_reg_glmnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ This model has 2 tuning parameters:

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

A value of `mixture = 1` corresponds to a pure lasso model, while `mixture = 0` indicates ridge regression.
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`:

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].
* `mixture = 1` specifies a pure lasso model,
* `mixture = 0` specifies a ridge regression model, and
* `0 < mixture < 1` specifies an elastic net model, interpolating lasso and ridge.

## Translation from parsnip to the original package

Expand Down
Loading