該函數打印當前的變量/特征集及其一些特征。
值
包含列 variable
、 type
、 role
和 source
的小標題。當 original = TRUE
時,會包含一個名為 required_to_bake
的附加列(基於 update_role_requirements()
的結果)。
例子
rec <- recipe(~., data = USArrests)
summary(rec)
#> # A tibble: 4 × 4
#> variable type role source
#> <chr> <list> <chr> <chr>
#> 1 Murder <chr [2]> predictor original
#> 2 Assault <chr [2]> predictor original
#> 3 UrbanPop <chr [2]> predictor original
#> 4 Rape <chr [2]> predictor original
rec <- step_pca(rec, all_numeric(), num_comp = 3)
summary(rec) # still the same since not yet trained
#> # A tibble: 4 × 4
#> variable type role source
#> <chr> <list> <chr> <chr>
#> 1 Murder <chr [2]> predictor original
#> 2 Assault <chr [2]> predictor original
#> 3 UrbanPop <chr [2]> predictor original
#> 4 Rape <chr [2]> predictor original
rec <- prep(rec, training = USArrests)
summary(rec)
#> # A tibble: 3 × 4
#> variable type role source
#> <chr> <list> <chr> <chr>
#> 1 PC1 <chr [2]> predictor derived
#> 2 PC2 <chr [2]> predictor derived
#> 3 PC3 <chr [2]> predictor derived
相關用法
- 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 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 step_regex 檢測正則表達式
- R recipes step_spline_b 基礎樣條
- R recipes step_window 移動窗口函數
- R recipes step_ica ICA 信號提取
- R recipes step_discretize 離散數值變量
- R recipes step_dummy_multi_choice 一起處理多個預測變量的水平
- R recipes step_lincomb 線性組合濾波器
注:本文由純淨天空篩選整理自Max Kuhn等大神的英文原創作品 Summarize a recipe。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。