Skip to content

Commit 115292d

Browse files
committed
Change kernlab to use formula interface, add indicator encoding
1 parent 172541c commit 115292d

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

R/svm_poly_data.R

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,39 @@ set_fit(
4949
eng = "kernlab",
5050
mode = "regression",
5151
value = list(
52-
interface = "matrix",
53-
protect = c("x", "y"),
52+
interface = "formula",
53+
protect = c("formula", "data"),
5454
func = c(pkg = "kernlab", fun = "ksvm"),
5555
defaults = list(kernel = "polydot")
5656
)
5757
)
5858

59+
set_encoding(
60+
model = "svm_poly",
61+
eng = "kernlab",
62+
mode = "regression",
63+
options = list(predictor_indicators = FALSE)
64+
)
65+
5966
set_fit(
6067
model = "svm_poly",
6168
eng = "kernlab",
6269
mode = "classification",
6370
value = list(
64-
interface = "matrix",
65-
protect = c("x", "y"),
71+
interface = "formula",
72+
protect = c("formula", "data"),
6673
func = c(pkg = "kernlab", fun = "ksvm"),
6774
defaults = list(kernel = "polydot")
6875
)
6976
)
7077

78+
set_encoding(
79+
model = "svm_poly",
80+
eng = "kernlab",
81+
mode = "classification",
82+
options = list(predictor_indicators = FALSE)
83+
)
84+
7185
set_pred(
7286
model = "svm_poly",
7387
eng = "kernlab",

0 commit comments

Comments
 (0)