當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


R butcher axe-train 砍掉火車物體。

火車對象是從創建的插入符包。

用法

# S3 method for train
axe_call(x, verbose = FALSE, ...)

# S3 method for train
axe_ctrl(x, verbose = FALSE, ...)

# S3 method for train
axe_data(x, verbose = FALSE, ...)

# S3 method for train
axe_env(x, verbose = FALSE, ...)

# S3 method for train
axe_fitted(x, verbose = FALSE, ...)

參數

x

一個模型對象。

verbose

每次執行 ax 方法時打印信息。記錄釋放了多少內存以及禁用了哪些函數。默認為 FALSE

...

與砍伐相關的任何其他參數。

砍掉的火車物體。

例子

# Load libraries
library(caret)

data(iris)
train_data <- iris[, 1:4]
train_classes <- iris[, 5]

train_fit <- train(train_data, train_classes,
                   method = "knn",
                   preProcess = c("center", "scale"),
                   tuneLength = 10,
                   trControl = trainControl(method = "cv"))

out <- butcher(train_fit, verbose = TRUE)
#> ✔ Memory released: 32.19 kB
#> ✖ Disabled: `summary()` and `update()`
源代碼:R/train.R

相關用法


注:本文由純淨天空篩選整理自Davis Vaughan等大神的英文原創作品 Axing a train object.。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。