View source: R/s_LightRuleFit.R
s_LightRuleFit | R Documentation |
Train a LightGBM gradient boosting model, extract rules, and fit using LASSO
s_LightRuleFit(
x,
y = NULL,
x.test = NULL,
y.test = NULL,
params = setup.LightRuleFit(),
lgbm.mod = NULL,
empirical_risk = TRUE,
cases_by_rules = NULL,
save_cases_by_rules = FALSE,
x.name = NULL,
y.name = NULL,
n.cores = rtCores,
question = NULL,
print.plot = FALSE,
plot.fitted = NULL,
plot.predicted = NULL,
plot.theme = rtTheme,
outdir = NULL,
save.mod = if (!is.null(outdir)) TRUE else FALSE,
verbose = TRUE,
trace = 0
)
x |
Numeric vector or matrix / data frame of features i.e. independent variables |
y |
Numeric vector of outcome, i.e. dependent variable |
x.test |
Numeric vector or matrix / data frame of testing set features
Columns must correspond to columns in |
y.test |
Numeric vector of testing set outcome |
params |
Training parameters for GBM and LASSO steps, set using setup.LightRuleFit. |
lgbm.mod |
rtMod object created by s_LightGBM. If provided, the gradient boosting step is skipped. |
empirical_risk |
Logical: If TRUE, calculate empirical risk |
cases_by_rules |
Matrix of cases by rules from a previoue rulefit run. If provided, the GBM step is skipped. |
save_cases_by_rules |
Logical: If TRUE, save cases_by_rules to object |
x.name |
Character: Name for feature set |
y.name |
Character: Name for outcome |
n.cores |
Integer: Number of cores to use |
question |
Character: the question you are attempting to answer with this model, in plain language. |
print.plot |
Logical: if TRUE, produce plot using |
plot.fitted |
Logical: if TRUE, plot True (y) vs Fitted |
plot.predicted |
Logical: if TRUE, plot True (y.test) vs Predicted.
Requires |
plot.theme |
Character: "zero", "dark", "box", "darkbox" |
outdir |
Path to output directory.
If defined, will save Predicted vs. True plot, if available,
as well as full model output, if |
save.mod |
Logical: If TRUE, save all output to an RDS file in |
verbose |
Logical: If TRUE, print summary to screen. |
trace |
Integer: Verbosity level |
Based on "Predictive Learning via Rule Ensembles" by Friedman and Popescu http://statweb.stanford.edu/~jhf/ftp/RuleFit.pdf
rtMod
object
E.D. Gennatas
Friedman JH, Popescu BE, "Predictive Learning via Rule Ensembles", http://statweb.stanford.edu/~jhf/ftp/RuleFit.pdf
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.