View source: R/linear_regression-fit.R
| linear_regression | R Documentation | 
linear_regressionlinear_regression() fits a model.
linear_regression(x, ...) ## Default S3 method: linear_regression(x, ...) ## S3 method for class 'data.frame' linear_regression(x, y, ...) ## S3 method for class 'matrix' linear_regression(x, y, ...) ## S3 method for class 'formula' linear_regression(formula, data, ...) ## S3 method for class 'recipe' linear_regression(x, data, ...)
| x | Depending on the context: 
 | 
| ... | Not currently used, but required for extensibility. | 
| y | When  
 | 
| formula | A formula specifying the outcome terms on the left-hand side, and the predictor terms on the right-hand side. | 
| data | When a recipe or formula is used,  
 | 
A linear_regression object.
set.seed(0) data <- simulate_dummy_linear_data() model <- linear_regression(y~., data, l1=0.05, l2=0.01, frob=0.01, num_comp=3) model new_data <- simulate_dummy_linear_data() predict(model, new_data, type = "numeric")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.