Skip to content

Commit 3c0a0e2

Browse files
authored
print (unknown mode) instead of (unknown) (#813)
1 parent c029446 commit 3c0a0e2

File tree

8 files changed

+26
-24
lines changed

8 files changed

+26
-24
lines changed

R/print.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ print_model_spec <- function(x, cls = class(x)[1], desc = get_model_desc(cls), .
1313
prompt_missing_implementation(spec = structure(x, class = cls), prompt = cli::cli_inform)
1414
}
1515

16-
cat(desc, " Model Specification (", x$mode, ")\n\n", sep = "")
16+
mode <- switch(x$mode, unknown = "unknown mode", x$mode)
17+
18+
cat(desc, " Model Specification (", mode, ")\n\n", sep = "")
1719
model_printer(x, ...)
1820

1921
if (is_printable_spec(x)) {

tests/testthat/_snaps/boost_tree.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
boost_tree(trees = 1) %>% set_engine("C5.0", noGlobalPruning = TRUE) %>% update(
55
trees = tune(), noGlobalPruning = tune())
66
Output
7-
Boosted Tree Model Specification (unknown)
7+
Boosted Tree Model Specification (unknown mode)
88
99
Main Arguments:
1010
trees = tune()

tests/testthat/_snaps/decision_tree.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
decision_tree(cost_complexity = 0.1) %>% set_engine("rpart", model = FALSE) %>%
55
update(cost_complexity = tune(), model = tune())
66
Output
7-
Decision Tree Model Specification (unknown)
7+
Decision Tree Model Specification (unknown mode)
88
99
Main Arguments:
1010
cost_complexity = tune()

tests/testthat/_snaps/mars.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Code
44
expr1 %>% update(num_terms = tune(), nk = tune())
55
Output
6-
MARS Model Specification (unknown)
6+
MARS Model Specification (unknown mode)
77
88
Main Arguments:
99
num_terms = tune()

tests/testthat/_snaps/misc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
i The parsnip extension packages censored and baguette implement support for this specification.
7272
i Please install (if needed) and load to continue.
7373
Output
74-
Bagged Decision Tree Model Specification (unknown)
74+
Bagged Decision Tree Model Specification (unknown mode)
7575
7676
Main Arguments:
7777
cost_complexity = 0
@@ -89,7 +89,7 @@
8989
i The parsnip extension packages censored and baguette implement support for this specification.
9090
i Please install (if needed) and load to continue.
9191
Output
92-
Bagged Decision Tree Model Specification (unknown)
92+
Bagged Decision Tree Model Specification (unknown mode)
9393
9494
Main Arguments:
9595
cost_complexity = 0

tests/testthat/_snaps/model_basics.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
i The parsnip extension package baguette implements support for this specification.
88
i Please install (if needed) and load to continue.
99
Output
10-
Bagged MARS Model Specification (unknown)
10+
Bagged MARS Model Specification (unknown mode)
1111
1212
Computational engine: earth
1313
@@ -21,7 +21,7 @@
2121
i The parsnip extension packages censored and baguette implement support for this specification.
2222
i Please install (if needed) and load to continue.
2323
Output
24-
Bagged Decision Tree Model Specification (unknown)
24+
Bagged Decision Tree Model Specification (unknown mode)
2525
2626
Main Arguments:
2727
cost_complexity = 0
@@ -35,7 +35,7 @@
3535
Code
3636
print(bart())
3737
Output
38-
BART Model Specification (unknown)
38+
BART Model Specification (unknown mode)
3939
4040
Computational engine: dbarts
4141
@@ -45,7 +45,7 @@
4545
Code
4646
print(boost_tree())
4747
Output
48-
Boosted Tree Model Specification (unknown)
48+
Boosted Tree Model Specification (unknown mode)
4949
5050
Computational engine: xgboost
5151
@@ -83,7 +83,7 @@
8383
Code
8484
print(decision_tree())
8585
Output
86-
Decision Tree Model Specification (unknown)
86+
Decision Tree Model Specification (unknown mode)
8787
8888
Computational engine: rpart
8989
@@ -149,7 +149,7 @@
149149
Code
150150
print(gen_additive_mod())
151151
Output
152-
GAM Model Specification (unknown)
152+
GAM Model Specification (unknown mode)
153153
154154
Computational engine: mgcv
155155
@@ -179,7 +179,7 @@
179179
Code
180180
print(mars())
181181
Output
182-
MARS Model Specification (unknown)
182+
MARS Model Specification (unknown mode)
183183
184184
Computational engine: earth
185185
@@ -189,7 +189,7 @@
189189
Code
190190
print(mlp())
191191
Output
192-
Single Layer Neural Network Model Specification (unknown)
192+
Single Layer Neural Network Model Specification (unknown mode)
193193
194194
Computational engine: nnet
195195
@@ -223,7 +223,7 @@
223223
Code
224224
print(nearest_neighbor())
225225
Output
226-
K-Nearest Neighbor Model Specification (unknown)
226+
K-Nearest Neighbor Model Specification (unknown mode)
227227
228228
Computational engine: kknn
229229
@@ -245,7 +245,7 @@
245245
i The parsnip extension package plsmod implements support for this specification.
246246
i Please install (if needed) and load to continue.
247247
Output
248-
PLS Model Specification (unknown)
248+
PLS Model Specification (unknown mode)
249249
250250
Computational engine: mixOmics
251251
@@ -283,7 +283,7 @@
283283
Code
284284
print(rand_forest())
285285
Output
286-
Random Forest Model Specification (unknown)
286+
Random Forest Model Specification (unknown mode)
287287
288288
Computational engine: ranger
289289
@@ -297,7 +297,7 @@
297297
i The parsnip extension packages agua and rules implement support for this specification.
298298
i Please install (if needed) and load to continue.
299299
Output
300-
RuleFit Model Specification (unknown)
300+
RuleFit Model Specification (unknown mode)
301301
302302
Computational engine: xrf
303303
@@ -321,7 +321,7 @@
321321
Code
322322
print(svm_linear())
323323
Output
324-
Linear Support Vector Machine Model Specification (unknown)
324+
Linear Support Vector Machine Model Specification (unknown mode)
325325
326326
Computational engine: LiblineaR
327327
@@ -331,7 +331,7 @@
331331
Code
332332
print(svm_poly())
333333
Output
334-
Polynomial Support Vector Machine Model Specification (unknown)
334+
Polynomial Support Vector Machine Model Specification (unknown mode)
335335
336336
Computational engine: kernlab
337337
@@ -341,7 +341,7 @@
341341
Code
342342
print(svm_rbf())
343343
Output
344-
Radial Basis Function Support Vector Machine Model Specification (unknown)
344+
Radial Basis Function Support Vector Machine Model Specification (unknown mode)
345345
346346
Computational engine: kernlab
347347

tests/testthat/_snaps/nearest_neighbor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
nearest_neighbor(neighbors = 5) %>% set_engine("kknn", scale = FALSE) %>%
55
update(neighbors = tune(), scale = tune())
66
Output
7-
K-Nearest Neighbor Model Specification (unknown)
7+
K-Nearest Neighbor Model Specification (unknown mode)
88
99
Main Arguments:
1010
neighbors = tune()

tests/testthat/_snaps/print.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Code
44
svm_poly()
55
Output
6-
Polynomial Support Vector Machine Model Specification (unknown)
6+
Polynomial Support Vector Machine Model Specification (unknown mode)
77
88
Computational engine: kernlab
99
@@ -13,7 +13,7 @@
1313
Code
1414
boost_tree(mtry = 5)
1515
Output
16-
Boosted Tree Model Specification (unknown)
16+
Boosted Tree Model Specification (unknown mode)
1717
1818
Main Arguments:
1919
mtry = 5

0 commit comments

Comments
 (0)