本文于2026-03-28更新。 如发现问题或者有建议,欢迎提交 Issue
gcForest包是使用调用python的gcForest的资源。
这是一个新包
library(tidyverse)
library(packagefinder)
library(dlstats)
library(cranly)
sem_pkg <-
'Deep Forest' %>%
findPackage() %>%
as_tibble()
sem_pkg_download <-
sem_pkg %>%
rename_all(tolower) %>%
arrange(desc(score)) %>%
distinct(name) %>%
# head(100) %>%
.$name %>%
# 可以插入 vector,所以不需要map
cran_stats()
sem_pkg_download数据预处理
训练模型
library(gcForest)
library(tidyverse)
library(lubridate)
gcforest_m <- gcforest(shape_1X=4L, window=2L, tolerance=0.0)
gcforest_m$fit(x_tr,y_tr)
gcf_model <-
model_save(
gcforest_m
,file.path(
'files'
,paste(today() %>% str_remove_all('-') %>% str_sub(3,-1),'gcforest_model.model',sep='_')
)
)
gcf <-
model_load(
file.path(
'files'
,list.files('files') %>% str_subset('gcforest_model.model') %>% max
)
)
gcf$fit(x_tr, y_tr)