Description
Least angle regression (LAR) and its most important modification, least absolute shrinkage and
selection operator (LASSO), are variants of linear regression that select the most important
variables, one by one, and fit the coefficients dynamically.
The td_lar_mle
function generates a model that the function td_lar_predict_mle
uses to make predictions for the response variables.
Usage
td_lar_mle ( formula = NULL, data = NULL, type = "LASSO", max.steps = NULL, normalize = TRUE, intercept = TRUE, data.sequence.column = NULL )
Arguments
formula |
Required Argument. |
data |
Required Argument. |
type |
Optional Argument. |
max.steps |
Optional Argument. |
normalize |
Optional Argument. |
intercept |
Optional Argument. |
data.sequence.column |
Optional Argument. |
Value
Function returns an object of class "td_lar_mle" which is a named list containing Teradata tbl objects. Named list members can be referenced directly with the "$" operator using following names:
output.table
sql.stdout
Examples
# Get the current context/connection con <- td_get_context()$connection # Load example data. # This input is diabetes data from "Least Angle Regression," by Bradley Efron and others. # This data set is atypical in that each predictor has mean 0 and norm 1 loadExampleData("lar_example", "diabetes") # Create remote tibble objects. diabetes <- tbl(con, "diabetes") # Rename columns in the tbl object to lower case, since the input table # contains one or more column names in upper case. diabetes_lower <- diabetes %>% rename_all(tolower) # Example - Build a LAR model with response variable 'y' and ten baseline predictors td_lar_out <- td_lar_mle(formula = (y ~ hdl + glu + ldl + map1 + sex + tch + age + ltg + bmi + tc), data = diabetes_lower, type = "LAR", max.steps = 20, intercept = TRUE )