coef.pre | R Documentation |
coef.pre
returns coefficients for prediction rules and linear terms in
the final ensemble
## S3 method for class 'pre'
coef(object, penalty.par.val = "lambda.1se", ...)
object |
object of class |
penalty.par.val |
character or numeric. Value of the penalty parameter
|
... |
Further arguments to be passed to |
In some cases, duplicated variable names may appear in the model. For example, the first variable is a factor named 'V1' and there are also variables named 'V10' and/or 'V11' and/or 'V12' (etc). Then for for the binary factor V1, dummy contrast variables will be created, named 'V10', 'V11', 'V12' (etc). As should be clear from this example, this yields duplicated variable names, which may yield problems, for example in the calculation of predictions and importances, later on. This can be prevented by renaming factor variables with numbers in their name, prior to analysis.
returns a dataframe with 3 columns: coefficient, rule (rule or
variable name) and description (NA
for linear terms, conditions for
rules).
pre
, plot.pre
,
cvpre
, importance.pre
, predict.pre
,
interact
, print.pre
set.seed(42)
airq.ens <- pre(Ozone ~ ., data = airquality[complete.cases(airquality),])
coefs <- coef(airq.ens)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.