Skip to content

Commit 135a544

Browse files
committed
delete redundant model print methods
note that the only changes needed to pass existing tests is 4 snapshot updates, where `"Model "` is added preceding `"Specification"` in the header.
1 parent f0eaa1e commit 135a544

34 files changed

+5
-402
lines changed

NAMESPACE

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -49,39 +49,10 @@ S3method(predict_raw,"_multnet")
4949
S3method(predict_raw,model_fit)
5050
S3method(predict_survival,model_fit)
5151
S3method(predict_time,model_fit)
52-
S3method(print,C5_rules)
53-
S3method(print,bag_mars)
54-
S3method(print,bag_tree)
55-
S3method(print,bart)
56-
S3method(print,boost_tree)
5752
S3method(print,control_parsnip)
58-
S3method(print,cubist_rules)
59-
S3method(print,decision_tree)
60-
S3method(print,discrim_flexible)
61-
S3method(print,discrim_linear)
62-
S3method(print,discrim_quad)
63-
S3method(print,discrim_regularized)
64-
S3method(print,gen_additive_mod)
65-
S3method(print,linear_reg)
66-
S3method(print,logistic_reg)
67-
S3method(print,mars)
68-
S3method(print,mlp)
6953
S3method(print,model_fit)
7054
S3method(print,model_spec)
71-
S3method(print,multinom_reg)
72-
S3method(print,naive_Bayes)
73-
S3method(print,nearest_neighbor)
7455
S3method(print,nullmodel)
75-
S3method(print,pls)
76-
S3method(print,poisson_reg)
77-
S3method(print,proportional_hazards)
78-
S3method(print,rand_forest)
79-
S3method(print,rule_fit)
80-
S3method(print,surv_reg)
81-
S3method(print,survival_reg)
82-
S3method(print,svm_linear)
83-
S3method(print,svm_poly)
84-
S3method(print,svm_rbf)
8556
S3method(req_pkgs,model_fit)
8657
S3method(req_pkgs,model_spec)
8758
S3method(required_pkgs,model_fit)
@@ -256,6 +227,7 @@ export(predict_survival.model_fit)
256227
export(predict_time)
257228
export(predict_time.model_fit)
258229
export(prepare_data)
230+
export(print_model_spec)
259231
export(proportional_hazards)
260232
export(rand_forest)
261233
export(repair_call)

R/bag_mars.R

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,6 @@ bag_mars <-
4242
)
4343
}
4444

45-
#' @export
46-
print.bag_mars <- function(x, ...) {
47-
cat("Bagged MARS Model Specification (", x$mode, ")\n\n", sep = "")
48-
model_printer(x, ...)
49-
50-
if (is_printable_spec(x)) {
51-
cat("Model fit template:\n")
52-
print(show_call(x))
53-
}
54-
invisible(x)
55-
}
56-
5745
# ------------------------------------------------------------------------------
5846

5947
#' @method update bag_mars

R/bag_tree.R

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,6 @@ bag_tree <-
4646
)
4747
}
4848

49-
#' @export
50-
print.bag_tree <- function(x, ...) {
51-
cat("Bagged Decision Tree Model Specification (", x$mode, ")\n\n", sep = "")
52-
model_printer(x, ...)
53-
54-
if (is_printable_spec(x)) {
55-
cat("Model fit template:\n")
56-
print(show_call(x))
57-
}
58-
invisible(x)
59-
}
60-
6149
# ------------------------------------------------------------------------------
6250

6351
#' @method update bag_tree

R/bart.R

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,6 @@ bart <-
9090
)
9191
}
9292

93-
#' @export
94-
print.bart <- function(x, ...) {
95-
cat("BART Model Specification (", x$mode, ")\n\n", sep = "")
96-
model_printer(x, ...)
97-
98-
if (is_printable_spec(x)) {
99-
cat("Model fit template:\n")
100-
print(show_call(x))
101-
}
102-
invisible(x)
103-
}
104-
10593
# ------------------------------------------------------------------------------
10694

10795
#' @method update bart

R/boost_tree.R

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,6 @@ boost_tree <-
7979
)
8080
}
8181

82-
#' @export
83-
print.boost_tree <- function(x, ...) {
84-
cat("Boosted Tree Model Specification (", x$mode, ")\n\n", sep = "")
85-
model_printer(x, ...)
86-
87-
if (is_printable_spec(x)) {
88-
cat("Model fit template:\n")
89-
print(show_call(x))
90-
}
91-
invisible(x)
92-
}
93-
9482
# ------------------------------------------------------------------------------
9583

9684
#' @method update boost_tree

R/c5_rules.R

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,6 @@ C5_rules <-
6363
)
6464
}
6565

66-
#' @export
67-
print.C5_rules <- function(x, ...) {
68-
cat("C5.0 Model Specification (", x$mode, ")\n\n", sep = "")
69-
model_printer(x, ...)
70-
71-
if (is_printable_spec(x)) {
72-
cat("Model fit template:\n")
73-
print(show_call(x))
74-
}
75-
76-
invisible(x)
77-
}
78-
79-
8066
# ------------------------------------------------------------------------------
8167

8268
#' Updating a model specification

R/cubist_rules.R

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,6 @@ cubist_rules <-
8989
)
9090
}
9191

92-
#' @export
93-
print.cubist_rules <- function(x, ...) {
94-
cat("Cubist Model Specification (", x$mode, ")\n\n", sep = "")
95-
model_printer(x, ...)
96-
97-
if (is_printable_spec(x)) {
98-
cat("Model fit template:\n")
99-
print(show_call(x))
100-
}
101-
102-
invisible(x)
103-
}
104-
105-
10692
# ------------------------------------------------------------------------------
10793

10894
#' @param object A Cubist model specification.

R/decision_tree.R

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,6 @@ decision_tree <-
5151
)
5252
}
5353

54-
#' @export
55-
print.decision_tree <- function(x, ...) {
56-
cat("Decision Tree Model Specification (", x$mode, ")\n\n", sep = "")
57-
model_printer(x, ...)
58-
59-
if (is_printable_spec(x)) {
60-
cat("Model fit template:\n")
61-
print(show_call(x))
62-
}
63-
invisible(x)
64-
}
65-
6654
# ------------------------------------------------------------------------------
6755

6856
#' @method update decision_tree

R/discrim_flexible.R

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,6 @@ discrim_flexible <-
4545
)
4646
}
4747

48-
#' @export
49-
print.discrim_flexible <- function(x, ...) {
50-
cat("Flexible Discriminant Model Specification (", x$mode, ")\n\n", sep = "")
51-
model_printer(x, ...)
52-
53-
if (is_printable_spec(x)) {
54-
cat("Model fit template:\n")
55-
print(show_call(x))
56-
}
57-
58-
invisible(x)
59-
}
60-
6148
# ------------------------------------------------------------------------------
6249

6350
#' Update a model specification

R/discrim_linear.R

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,6 @@ discrim_linear <-
4747
)
4848
}
4949

50-
#' @export
51-
print.discrim_linear <- function(x, ...) {
52-
cat("Linear Discriminant Model Specification (", x$mode, ")\n\n", sep = "")
53-
model_printer(x, ...)
54-
55-
if (is_printable_spec(x)) {
56-
cat("Model fit template:\n")
57-
print(show_call(x))
58-
}
59-
60-
invisible(x)
61-
}
62-
6350
# ------------------------------------------------------------------------------
6451

6552
#' @method update discrim_linear

0 commit comments

Comments
 (0)