Interactions

R में Supervised Learning: Regression

Nina Zumel and John Mount

Win-Vector, LLC

Additive relationships

योगात्मक संबंध का उदाहरण:

plant_height ~ bacteria + sun
  • ऊँचाई में बदलाव = bacteria और sunlight के प्रभावों का योग
    • sunlight बदलने पर ऊँचाई में वही बदलाव आता है, bacteria से स्वतंत्र
    • bacteria बदलने पर ऊँचाई में वही बदलाव आता है, sunlight से स्वतंत्र
R में Supervised Learning: Regression

What is an Interaction?

दो वैरिएबल्स का एक साथ प्रभाव योगात्मक नहीं है.

plant_height ~ bacteria + sun + bacteria:sun
  • ऊँचाई में बदलाव, sun/bacteria के प्रभावों के योग से ज्यादा (या कम) होता है
  • अधिक sunlight पर, bacteria में 1 यूनिट बदलाव से ऊँचाई में ज्यादा परिवर्तन आता है
R में Supervised Learning: Regression

What is an Interaction?

दो वैरिएबल्स का एक साथ प्रभाव योगात्मक नहीं है.

plant_height ~ bacteria + sun + bacteria:sun
  • sun: categorical {"sun", "shade"}
  • sun में, bacteria के 1 यूनिट बदलाव से ऊँचाई में m यूनिट बदलाव आता है
  • shade में, bacteria के 1 यूनिट बदलाव से ऊँचाई में n यूनिट बदलाव आता है

मानो दो अलग मॉडल: एक sun के लिए, एक shade के लिए.

R में Supervised Learning: Regression

Example of no Interaction: Soybean Yield

yield ~ Stress + SO2 + O3

R में Supervised Learning: Regression

Example of an Interaction: Alcohol Metabolism

Metabol ~ Gastric + Sex

R में Supervised Learning: Regression

Expressing Interactions in Formulae

  • Interaction - Colon (:)

    y ~ a:b
    
  • Main effects और interaction - Asterisk (*)

    y ~ a*b
    # Both mean the same
    y ~ a + b + a:b
    
  • दो वैरिएबल्स के product को लिखना - I

    y ~ I(a*b)
    

    same as $y \propto a b$

R में Supervised Learning: Regression

Finding the Correct Interaction Pattern

Formula RMSE (cross validation)
Metabol ~ Gastric + Sex 1.46
Metabol ~ Gastric * Sex 1.48
Metabol ~ Gastric + Gastric:Sex 1.39
R में Supervised Learning: Regression

अभ्यास करते हैं!

R में Supervised Learning: Regression

Preparing Video For Download...