r descr_models("ordinal_reg", "ordinalNet")
defaults <- tibble::tibble( parsnip = c("ordinal_link", "odds_link", "penalty", "mixture"), default = c("logit", "cumulative", "see below", "1.0") ) param <- ordinal_reg() |> set_engine("ordinalNet") |> make_parameter_list(defaults)
This model has r nrow(param) tuning parameters:
param$item
r uses_extension("ordinal_reg", "ordinalNet", "classification")
library(ordered) ordinal_reg( penalty = double(0), mixture = double(0), ordinal_link = character(0), odds_link = character(0) ) %>% set_engine("ordinalNet") %>% # "classification" is the only mode translate()
ordinalNet(), like glmnet(), simultaneously computes a set of parameter estimates for multiple penalty values. Predictions can be made at these penalty values at the same time. However, unlike glmnet(), ordinalNet() does not interpolate if you want to predict using penalty values not exactly among those it precomputed. Similarly, it cannot predict for models with penalties outside of the range of those precomputed.
The \pkg{ordered} package can interpolate between the preset penalty values but cannot predict outside of their range; this will cause an error.
We suggest that you set the collection of penalty values when fitting the model. This is important when tuning the model. Different data sets and mixture values (a.k.a. alpha) will pair best with different sets of penalties and it might be good to set a wide range.
To do this, you can use set_engine() to pass a vector of penalty values as so:
# Example of setting a wide penalty range penalties <- 10^seq(-10, 0, length.out = 20) ordinal_reg(penalty = tune()) |> set_engine("ordinalNet", path_values = !!penalties)
See [glmnet-details] for more background.
#| child: template-makes-dummies.Rmd
#| child: template-same-scale.Rmd
By default, [ordinalNet::ordinalNet()] uses the argument standardize = TRUE to center and scale the data.
#| child: template-uses-case-weights.Rmd
#| label: predict-types parsnip:::get_from_env("ordinal_reg_predict") |> dplyr::filter(engine == "ordinalNet") |> dplyr::select(mode, type)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.