Fitting a linear regression model
The parsnip package provides a unified syntax for the model fitting process in R.
With parsnip, it is easy to define models using the various packages, or engines, that exist in the R ecosystem.
In this exercise, you will define a parsnip linear regression object and train your model to predict selling_price using home_age and sqft_living as predictor variables from the home_sales data.
The home_training and home_test tibbles that you created in the previous lesson have been loaded into this session.
Este exercício faz parte do curso
Modeling with tidymodels in R
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Initialize a linear regression object, linear_model
linear_model <- ___ %>%
# Set the model engine
___ %>%
# Set the model mode
___