manual_rset()
用於構造盡可能最小的 rset。當您擁有從 make_splits()
構建的自定義 rsplit 對象時,或者當您想要從現有 rset 中包含的拆分創建新的 rset 時,它會很有用。
參數
- splits
-
"rsplit"
對象的列表。使用make_splits()
創建它們是最簡單的。 - ids
-
id 的字符向量。
ids
的長度必須與splits
的長度相同。
例子
df <- data.frame(x = c(1, 2, 3, 4, 5, 6))
# Create an rset from custom indices
indices <- list(
list(analysis = c(1L, 2L), assessment = 3L),
list(analysis = c(4L, 5L), assessment = 6L)
)
splits <- lapply(indices, make_splits, data = df)
manual_rset(splits, c("Split 1", "Split 2"))
#> # Manual resampling
#> # A tibble: 2 × 2
#> splits id
#> <list> <chr>
#> 1 <split [2/1]> Split 1
#> 2 <split [2/1]> Split 2
# You can also use this to create an rset from a subset of an
# existing rset
resamples <- vfold_cv(mtcars)
best_split <- resamples[5, ]
manual_rset(best_split$splits, best_split$id)
#> # Manual resampling
#> # A tibble: 1 × 2
#> splits id
#> <list> <chr>
#> 1 <split [29/3]> Fold05
相關用法
- R rsample make_splits 分割對象的構造函數
- R rsample make_strata 創建或修改分層變量
- R rsample mc_cv 蒙特卡羅交叉驗證
- R rsample validation_set 創建驗證拆分以進行調整
- R rsample initial_split 簡單的訓練/測試集分割
- R rsample populate 添加評估指標
- R rsample int_pctl 自舉置信區間
- R rsample vfold_cv V 折交叉驗證
- R rsample rset_reconstruct 使用新的 rset 子類擴展 rsample
- R rsample group_mc_cv 小組蒙特卡羅交叉驗證
- R rsample group_vfold_cv V 組交叉驗證
- R rsample rolling_origin 滾動原點預測重采樣
- R rsample reverse_splits 反轉分析和評估集
- R rsample group_bootstraps 團體自舉
- R rsample labels.rset 從 rset 對象中查找標簽
- R rsample get_fingerprint 獲取重采樣的標識符
- R rsample bootstraps 引導抽樣
- R rsample validation_split 創建驗證集
- R rsample reg_intervals 具有線性參數模型的置信區間的便捷函數
- R rsample clustering_cv 集群交叉驗證
- R rsample initial_validation_split 創建初始訓練/驗證/測試拆分
- R rsample get_rsplit 從 rset 中檢索單個 rsplit 對象
- R rsample loo_cv 留一交叉驗證
- R rsample complement 確定評估樣本
- R rsample slide-resampling 基於時間的重采樣
注:本文由純淨天空篩選整理自Hannah Frick等大神的英文原創作品 Manual resampling。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。