svm_fillmap: Replace colors in SVM fill plot

Description Usage Arguments Examples

View source: R/svm_fillmap.R

Description

Replace colors in SVM fill plot

Usage

1
svm_fillmap(g, fillmap = NULL, s_lim = NULL)

Arguments

g

g should be an object output from ‘plot_svm_jk()“ where fill_plot = T. It’s crucial that it's from that function because I embedded some information into the g$s_lim_jk.

fillmap

This should be a diverging color palette. Default is using just 'scale_fill_gradient2()'

s_lim

This is the upper limit for the new scale. The lower limit is -s_lim. You can set this to a specific number, but it defaults to the highest number needed for the plot.

Examples

1
2
3
4
5
data(df)
library(e1071)
model <- svm(label ~ x1 + x2, data = df, kernel = "radial", gamma = 1, scale = F, cost = 1.8)
g <- plot_svm_jk(df,model,fill_plot = T, plot_contour = F, plot_decision = F)
svm_fillmap(g)

jakubkovac/Lori documentation built on Jan. 9, 2020, 9:49 p.m.