LoslegenKostenlos loslegen

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.

Diese Übung ist Teil des Kurses

Modeling with tidymodels in R

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Initialize a linear regression object, linear_model
linear_model <- ___ %>% 
  # Set the model engine
  ___ %>% 
  # Set the model mode
  ___
Code bearbeiten und ausführen