1. सीखें
  2. /
  3. पाठ्यक्रम
  4. /
  5. Supervised Learning in R: Regression

Connected

अभ्यास

Train a model using test/train split

Now that you have split the mpg dataset into mpg_train and mpg_test, you will use mpg_train to train a model to predict city fuel efficiency (cty) from highway fuel efficiency (hwy).

The mpg_train data frame has been loaded for you.

निर्देश

100 XP
  • Create a formula fmla that expresses the relationship cty as a function of hwy. Print it.
  • Train a model mpg_model on mpg_train to predict cty from hwy using fmla and lm().
  • Use summary() to examine the model.