当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


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.。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。