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


R butcher axe-earth 砍伐地球物體。

地球物體是由地球包,它被用來做多元自適應回歸樣條。

用法

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

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

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

參數

x

一個模型對象。

verbose

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

...

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

被砍伐的地球物體。

例子

# Load libraries
library(parsnip)

# Create model and fit
earth_fit <- mars(mode = "regression") %>%
  set_engine("earth") %>%
  fit(Volume ~ ., data = trees)
#> Loading required package: Formula
#> Loading required package: plotmo
#> Loading required package: plotrix
#> Loading required package: TeachingDemos
#> 
#> Attaching package: ‘TeachingDemos’
#> The following object is masked from ‘package:klaR’:
#> 
#>     triplot

out <- butcher(earth_fit, verbose = TRUE)
#> ✖ The butchered object is 2.02 kB larger than the original. Do not butcher.

# Another earth model object
suppressWarnings(suppressMessages(library(earth)))
earth_mod <- earth(Volume ~ ., data = trees)
out <- butcher(earth_mod, verbose = TRUE)
#> ✖ The butchered object is 712 B larger than the original. Do not butcher.
源代碼:R/earth.R

相關用法


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