Lab 05

Recipes + Model comparison

Oct 20 - 21, 2022

Welcome

Goals

  • Review interaction effects
  • Lab 05: Halloween candy

Interaction terms

Diamonds data

The data contain the price and other attributes of a random sample of 1000 diamonds. This sample was drawn from the diamonds data frame in the tidyverse R package.

The variables in this example are

  • price: Price in US dollars

  • carat: Weight of the diamond (units = carats)

  • cut: Quality of the cut of the diamond (Fair, Good, Ideal)

The goal is to use the carat and cut to understand variability in the price.

Exploratory data analysis

Does the plot show evidence of an interaction effect between carats and cut?

Model

term estimate
(Intercept) -2473.555
carat 6383.913
cutGood 60.018
cutIdeal 0.044
carat:cutGood 982.952
carat:cutIdeal 2132.642
  • Interpret the coefficient of cutGood in the context of the data.
  • Interpret the coefficient of carat:cutGood in the context of the data.
  • Suppose we fit a model for Fair cut diamonds. What is the intercept? What is the slope of carat ?
  • Suppose we fit a model for Ideal cut diamonds. What is the intercept? What is the slope of carat?

Lab 05: Recipes + Model Comparison

Resources for Lab 05

  • Lecture notes:

    • Feature engineering
    • Feature engineering: Model workflow
    • Model comparison
  • Recipes package function reference

  • Tidy Modeling in R - Chapter 8: Feature engineering with recipes

🔗 Week 08

1 / 10
Lab 05 Recipes + Model comparison Oct 20 - 21, 2022

  1. Slides

  2. Tools

  3. Close
  • Lab 05
  • Slide 2
  • Welcome
  • Goals
  • Interaction terms
  • Diamonds data
  • Exploratory data analysis
  • Model
  • Lab 05: Recipes + Model Comparison
  • Resources for Lab 05
  • f Fullscreen
  • s Speaker View
  • o Slide Overview
  • e PDF Export Mode
  • b Toggle Chalkboard
  • c Toggle Notes Canvas
  • d Download Drawings
  • ? Keyboard Help