การพล็อตปฏิสัมพันธ์ใน GAM

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

Noam Ross

Senior Research Scientist, EcoHealth Alliance

ใช้คำสั่ง plot() ของ mgcv กับปฏิสัมพันธ์

plot(mod_2d)

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

ใช้ plot() ของ mgcv กับปฏิสัมพันธ์

plot(mod_2d, scheme = 1)

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

ใช้ plot() ของ mgcv กับปฏิสัมพันธ์

plot(mod_2d, scheme = 2)

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

ปรับแต่งกราฟปฏิสัมพันธ์ด้วย vis.gam()

vis.gam(x,
        view = NULL,
        cond = list(),
        n.grid = 30,
        too.far = 0,
        col = NA,
        color = "heat",
        contour.col = NULL,
        se = -1,
        type = "link",
        plot.type = "persp",
        zlim = NULL,
        nCol = 50,
        ...)
การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

ปรับแต่งกราฟปฏิสัมพันธ์ด้วย vis.gam()

vis.gam(x = mod,                # GAM object
        view = c("x1", "x2"),   # variables
        plot.type = "persp")    # kind of plot 

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

ปรับแต่งกราฟปฏิสัมพันธ์ด้วย vis.gam() (2)

vis.gam(x = mod,                # GAM object
        view = c("x1", "x2"),   # variables
        plot.type = "contour")  # kind of plot 

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

ปรับแต่งกราฟปฏิสัมพันธ์ด้วย vis.gam()

vis.gam(mod, view = c("x1", "x2"), plot.type = "contour", too.far = 0.1)
vis.gam(mod, view = c("x1", "x2"), plot.type = "contour", too.far = 0.05)

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

ตัวเลือกสำหรับกราฟเพอร์สเปกทีฟ

vis.gam(x = mod, view = c("x1", "x2"), 
        plot.type = "persp", se = 2)                  

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

ตัวเลือกสำหรับกราฟเพอร์สเปกทีฟ

vis.gam(g, view = c("x1", "x2"), plot.type = "persp", 
                                 theta = 220)
vis.gam(g, view = c("x1", "x2"), plot.type = "persp", 
                                 phi = 55)
vis.gam(g, view = c("x1", "x2"), plot.type = "persp", 
                                 r = 0.1)

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

ตัวเลือกสำหรับกราฟคอนทัวร์

vis.gam(g, view = c("x1", "x2"), plot.type = "contour",
                                 color = "gray")
vis.gam(g, view = c("x1", "x2"), plot.type = "contour",
                                 contour.col = "blue")
vis.gam(g, view = c("x1", "x2"), plot.type = "contour",
                                 nlevels = 20)

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

มาลองพล็อตกราฟกันเถอะ!

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

Preparing Video For Download...