tidy
將返回一個數據幀,其中包含有關配方或配方中的操作的信息(當該操作的 tidy
方法存在時)。
用法
# S3 method for step_BoxCox
tidy(x, ...)
# S3 method for step_YeoJohnson
tidy(x, ...)
# S3 method for step_arrange
tidy(x, ...)
# S3 method for step_bin2factor
tidy(x, ...)
# S3 method for step_bs
tidy(x, ...)
# S3 method for step_center
tidy(x, ...)
# S3 method for check_class
tidy(x, ...)
# S3 method for step_classdist
tidy(x, ...)
# S3 method for step_classdist_shrunken
tidy(x, ...)
# S3 method for check_cols
tidy(x, ...)
# S3 method for step_corr
tidy(x, ...)
# S3 method for step_count
tidy(x, ...)
# S3 method for step_cut
tidy(x, ...)
# S3 method for step_date
tidy(x, ...)
# S3 method for step_depth
tidy(x, ...)
# S3 method for step_discretize
tidy(x, ...)
# S3 method for step_dummy
tidy(x, ...)
# S3 method for step_dummy_extract
tidy(x, ...)
# S3 method for step_dummy_multi_choice
tidy(x, ...)
# S3 method for step_factor2string
tidy(x, ...)
# S3 method for step_filter
tidy(x, ...)
# S3 method for step_filter_missing
tidy(x, ...)
# S3 method for step_geodist
tidy(x, ...)
# S3 method for step_harmonic
tidy(x, ...)
# S3 method for step_holiday
tidy(x, ...)
# S3 method for step_hyperbolic
tidy(x, ...)
# S3 method for step_ica
tidy(x, ...)
# S3 method for step_impute_bag
tidy(x, ...)
# S3 method for step_impute_knn
tidy(x, ...)
# S3 method for step_impute_linear
tidy(x, ...)
# S3 method for step_impute_lower
tidy(x, ...)
# S3 method for step_impute_mean
tidy(x, ...)
# S3 method for step_impute_median
tidy(x, ...)
# S3 method for step_impute_mode
tidy(x, ...)
# S3 method for step_impute_roll
tidy(x, ...)
# S3 method for step_indicate_na
tidy(x, ...)
# S3 method for step_integer
tidy(x, ...)
# S3 method for step_interact
tidy(x, ...)
# S3 method for step_intercept
tidy(x, ...)
# S3 method for step_inverse
tidy(x, ...)
# S3 method for step_invlogit
tidy(x, ...)
# S3 method for step_isomap
tidy(x, ...)
# S3 method for step_kpca
tidy(x, ...)
# S3 method for step_kpca_poly
tidy(x, ...)
# S3 method for step_kpca_rbf
tidy(x, ...)
# S3 method for step_lag
tidy(x, ...)
# S3 method for step_lincomb
tidy(x, ...)
# S3 method for step_log
tidy(x, ...)
# S3 method for step_logit
tidy(x, ...)
# S3 method for check_missing
tidy(x, ...)
# S3 method for step_mutate
tidy(x, ...)
# S3 method for step_mutate_at
tidy(x, ...)
# S3 method for step_naomit
tidy(x, ...)
# S3 method for check_new_values
tidy(x, ...)
# S3 method for step_nnmf
tidy(x, ...)
# S3 method for step_nnmf_sparse
tidy(x, ...)
# S3 method for step_normalize
tidy(x, ...)
# S3 method for step_novel
tidy(x, ...)
# S3 method for step_ns
tidy(x, ...)
# S3 method for step_num2factor
tidy(x, ...)
# S3 method for step_nzv
tidy(x, ...)
# S3 method for step_ordinalscore
tidy(x, ...)
# S3 method for step_other
tidy(x, ...)
# S3 method for step_pca
tidy(x, type = "coef", ...)
# S3 method for step_percentile
tidy(x, ...)
# S3 method for step_pls
tidy(x, ...)
# S3 method for step_poly
tidy(x, ...)
# S3 method for step_poly_bernstein
tidy(x, ...)
# S3 method for step_profile
tidy(x, ...)
# S3 method for step_range
tidy(x, ...)
# S3 method for check_range
tidy(x, ...)
# S3 method for step_ratio
tidy(x, ...)
# S3 method for step_regex
tidy(x, ...)
# S3 method for step_relevel
tidy(x, ...)
# S3 method for step_relu
tidy(x, ...)
# S3 method for step_rename
tidy(x, ...)
# S3 method for step_rename_at
tidy(x, ...)
# S3 method for step_rm
tidy(x, ...)
# S3 method for step_sample
tidy(x, ...)
# S3 method for step_scale
tidy(x, ...)
# S3 method for step_select
tidy(x, ...)
# S3 method for step_shuffle
tidy(x, ...)
# S3 method for step_slice
tidy(x, ...)
# S3 method for step_spatialsign
tidy(x, ...)
# S3 method for step_spline_b
tidy(x, ...)
# S3 method for step_spline_convex
tidy(x, ...)
# S3 method for step_spline_monotone
tidy(x, ...)
# S3 method for step_spline_natural
tidy(x, ...)
# S3 method for step_spline_nonnegative
tidy(x, ...)
# S3 method for step_sqrt
tidy(x, ...)
# S3 method for step_string2factor
tidy(x, ...)
# S3 method for recipe
tidy(x, number = NA, id = NA, ...)
# S3 method for step
tidy(x, ...)
# S3 method for check
tidy(x, ...)
# S3 method for step_time
tidy(x, ...)
# S3 method for step_unknown
tidy(x, ...)
# S3 method for step_unorder
tidy(x, ...)
# S3 method for step_window
tidy(x, ...)
# S3 method for step_zv
tidy(x, ...)
參數
- x
-
recipe
對象、步驟或檢查(經過訓練或以其他方式)。 - ...
-
目前未使用。
- type
-
對於
step_pca
,可以是"coef"
(對於每個組件的變量加載)或"variance"
(每個組件占多少方差)。 - number
-
整數或
NA
。如果缺少且未提供id
,則返回值是配方中的操作列表。如果給出了一個數字,則為配方中的該操作執行tidy
方法(如果存在)。如果提供id
,則不得提供number
。 - id
-
字符串或
NA
。如果缺少且未提供number
,則返回值是配方中的操作列表。如果給出了字符串,則為配方中的該操作執行tidy
方法(如果存在)。如果提供number
,則不得提供id
。
值
一個小標題,其中的列根據執行的 tidy
方法而變化。當 number
和 id
為 NA
時,包含列 number
(操作迭代)、operation
("step" 或 "check")、type
(方法,例如 "nzv"、"center")、一個名為 trained
的邏輯列(用於確定操作是否已使用 prep
進行估計)、一個邏輯列 skip
以及一個字符列 id
。
例子
data(Sacramento, package = "modeldata")
Sacramento_rec <- recipe(~., data = Sacramento) %>%
step_other(all_nominal(), threshold = 0.05, other = "another") %>%
step_center(all_numeric()) %>%
step_dummy(all_nominal()) %>%
check_cols(ends_with("ude"), sqft, price)
tidy(Sacramento_rec)
#> # A tibble: 4 × 6
#> number operation type trained skip id
#> <int> <chr> <chr> <lgl> <lgl> <chr>
#> 1 1 step other FALSE FALSE other_rHEnN
#> 2 2 step center FALSE FALSE center_0byij
#> 3 3 step dummy FALSE FALSE dummy_GJcNB
#> 4 4 check cols FALSE FALSE cols_IeIAm
tidy(Sacramento_rec, number = 2)
#> # A tibble: 1 × 3
#> terms value id
#> <chr> <dbl> <chr>
#> 1 all_numeric() NA center_0byij
tidy(Sacramento_rec, number = 3)
#> # A tibble: 1 × 3
#> terms columns id
#> <chr> <chr> <chr>
#> 1 all_nominal() NA dummy_GJcNB
Sacramento_rec_trained <- prep(Sacramento_rec, training = Sacramento)
tidy(Sacramento_rec_trained)
#> # A tibble: 4 × 6
#> number operation type trained skip id
#> <int> <chr> <chr> <lgl> <lgl> <chr>
#> 1 1 step other TRUE FALSE other_rHEnN
#> 2 2 step center TRUE FALSE center_0byij
#> 3 3 step dummy TRUE FALSE dummy_GJcNB
#> 4 4 check cols TRUE FALSE cols_IeIAm
tidy(Sacramento_rec_trained, number = 3)
#> # A tibble: 6 × 3
#> terms columns id
#> <chr> <chr> <chr>
#> 1 city ROSEVILLE dummy_GJcNB
#> 2 city SACRAMENTO dummy_GJcNB
#> 3 city another dummy_GJcNB
#> 4 zip another dummy_GJcNB
#> 5 type Residential dummy_GJcNB
#> 6 type another dummy_GJcNB
tidy(Sacramento_rec_trained, number = 4)
#> # A tibble: 4 × 2
#> terms id
#> <chr> <chr>
#> 1 latitude cols_IeIAm
#> 2 longitude cols_IeIAm
#> 3 sqft cols_IeIAm
#> 4 price cols_IeIAm
相關用法
- R recipes step_unknown 將缺失的類別分配給“未知”
- R recipes step_relu 應用(平滑)修正線性變換
- R recipes step_poly_bernstein 廣義伯恩斯坦多項式基
- R recipes step_impute_knn 通過 k 最近鄰進行插補
- R recipes step_impute_mean 使用平均值估算數值數據
- R recipes step_inverse 逆變換
- R recipes step_pls 偏最小二乘特征提取
- R recipes update.step 更新菜譜步驟
- R recipes step_ratio 比率變量創建
- R recipes step_geodist 兩個地點之間的距離
- R recipes step_nzv 近零方差濾波器
- R recipes step_nnmf 非負矩陣分解信號提取
- R recipes step_normalize 中心和比例數值數據
- R recipes step_depth 數據深度
- R recipes step_other 折疊一些分類級別
- R recipes step_harmonic 添加正弦和餘弦項以進行諧波分析
- R recipes step_corr 高相關濾波器
- R recipes step_novel 新因子水平的簡單賦值
- R recipes step_select 使用 dplyr 選擇變量
- R recipes formula.recipe 從準備好的食譜創建配方
- R recipes step_regex 檢測正則表達式
- R recipes step_spline_b 基礎樣條
- R recipes step_window 移動窗口函數
- R recipes step_ica ICA 信號提取
- R recipes check_range 檢查範圍一致性
注:本文由純淨天空篩選整理自Max Kuhn等大神的英文原創作品 Tidy the Result of a Recipe。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。