Web Analytics

missForest

⭐ 109 stars Vietnamese by stekhoven

🌐 Ngôn ngữ

missForest

CRAN status CRAN RStudio mirror downloads CRAN RStudio mirror downloads R-CMD-check test-coverage License: GPL (≥ 2)-blue.svg)

missForest là một phương pháp nội suy phi tham số dành cho dữ liệu dạng bảng hỗn hợp kiểu trong R. Nó xử lý đồng thời các biến số và phân loại bằng cách huấn luyện rừng ngẫu nhiên lặp lại để dự đoán các giá trị thiếu từ các giá trị quan sát được. Không giả định mô hình rõ ràng, không phân tích ma trận—chỉ sử dụng các mô hình dự đoán mạnh mẽ có hiệu quả ngay khi sử dụng.

Gói này cũng bao gồm các tiện ích để đo lường lỗi nội suy, tạo giá trị thiếu cho các thí nghiệm và kiểm tra kiểu biến.


Cài đặt

# CRAN (recommended)
install.packages("missForest")

Development version (from GitHub)

install.packages("remotes")

remotes::install_github("stekhoven/missForest")


Quick start

library(missForest)

Example data

data(iris)

Introduce ~20% MCAR missingness

set.seed(81) iris_mis <- prodNA(iris, noNA = 0.20)

Impute with default backend (ranger)

imp <- missForest(iris_mis, xtrue = iris, verbose = TRUE)

Imputed data

head(imp$ximp)

Estimated OOB errors (NRMSE for numeric, PFC for factors)

imp$OOBerror

True error if xtrue was provided (for benchmarking only)

imp$error

Lựa chọn backend

# Legacy behavior using randomForest
imp_rf <- missForest(iris_mis, backend = "randomForest")

Explicitly use ranger with limited threads

imp_rg <- missForest(iris_mis, backend = "ranger", num.threads = 2)

Song song hóa

Hai chế độ có sẵn thông qua parallelize:

# Not run:

library(doParallel)

registerDoParallel(2)

imp_vars <- missForest(iris_mis, parallelize = "variables", verbose = TRUE)

imp_fors <- missForest(iris_mis, parallelize = "forests", verbose = TRUE, num.threads = 2)


Tổng quan API

missForest(xmis, ...)

Hàm nội suy chính.

Các tham số chính:

Một số ánh xạ tham số cho backend = "ranger":

Tiện ích

---

Mẹo & thực tiễn tốt nhất

  set.seed(123); imp <- missForest(x)
  ``
  • Bạn có thể giảm ntree trong quá trình thử nghiệm để tăng tốc độ lặp.
---

Trích dẫn

Nếu bạn sử dụng missForest, vui lòng trích dẫn:

Stekhoven, D. J. & Bühlmann, P. (2012). MissForest—nonparametric missing value imputation for mixed-type data.* Bioinformatics, 28(1), 112–118. https://doi.org/10.1093/bioinformatics/btr597

Bạn cũng có thể trích dẫn gói phần mềm này:

r citation("missForest") ``


Contributing

Issues and pull requests are welcome. Please include a minimal reproducible example when reporting bugs. For performance discussions, share small benchmarks and session info.


License

GPL (≥ 2)


Contact

Daniel J. Stekhoven — stekhoven@nexus.ethz.ch


--- Tranlated By Open Ai Tx | Last indexed: 2026-07-17 ---