包 e1071 的 plot 函数中的 slice 选项
slice option in plot function of package e1071
我在 R 中使用 e1071 包。只是想知道 plot 函数的 slice 选项在下面的代码中做了什么。我已经阅读了该软件包的手册,但不明白其中的内容。
iris.svm <- svm(Species ~ ., data = iris, probability = TRUE)
plot(iris.svm, data = iris, Petal.Width ~ Petal.Length, slice = list(Sepal.Width = 3, Sepal.Length = 6))
谢谢。
来自?plot.svm
slice a list of named numeric values for the dimensions held constant (only needed if more than two variables are used). Dimensions not specified are fixed at 0.
换句话说,当可视化预测变量对响应的影响时,您可以指定哪些 other 预测变量将保持不变(即固定值)。
因此,在您的示例中,您正在可视化预测变量 Petal.Length
和 Petal.Width
对响应的影响,同时保持 Sepal.Width
和 Sepal.Length
不变指定值。
我在 R 中使用 e1071 包。只是想知道 plot 函数的 slice 选项在下面的代码中做了什么。我已经阅读了该软件包的手册,但不明白其中的内容。
iris.svm <- svm(Species ~ ., data = iris, probability = TRUE)
plot(iris.svm, data = iris, Petal.Width ~ Petal.Length, slice = list(Sepal.Width = 3, Sepal.Length = 6))
谢谢。
来自?plot.svm
slice a list of named numeric values for the dimensions held constant (only needed if more than two variables are used). Dimensions not specified are fixed at 0.
换句话说,当可视化预测变量对响应的影响时,您可以指定哪些 other 预测变量将保持不变(即固定值)。
因此,在您的示例中,您正在可视化预测变量 Petal.Length
和 Petal.Width
对响应的影响,同时保持 Sepal.Width
和 Sepal.Length
不变指定值。