0
전처리 단계 을 수행 한 후 데이터에 액세스하는 방법이 있습니까? (mlr)? 다음은 코드를 제거한 버전입니다.mlr - 전처리 단계 간 또는 이후 데이터 액세스
library(mlr)
library(mlbench)
data <- BreastCancer[, 2:11]
lrn <- makeLearner(cl = "classif.ranger",
predict.type = "prob",
fix.factors.prediction = TRUE,
importance = "permutation")
lrn <- makeImputeWrapper(lrn, classes = list(integer = imputeMedian(),
numeric = imputeHist(),
factor = imputeMode()))
lrn <- makeRemoveConstantFeaturesWrapper(lrn, na.ignore = TRUE)
classif.task <- makeClassifTask(data = rawdata, target = "Target", positive = "1")
model <- train(lrn, classif.task)
이 코드는 학습자를 정의하고 상수 기능을 제거하고 대체를 수행합니다. 데이터가 상수 기능을 제거한 후 어떻게 보일지, 아니면 더 흥미롭게도 대체 후 어떻게 보이는지 볼 수있는 방법이 있습니까?
빠른 응답을 보내 주셔서 감사합니다. 래퍼를 사용하는 이유 (예 : 위에서 언급하지 않은 커스텀 코드는 하나의 함수로 트레이닝과 스코어링 코드를 통합하면서 둘 사이에 인수를 전달하는 것 (필요한 경우 하이퍼 파라미터 튜닝을 수행함)입니다. 그러나 "실제"워크 플로 내에서 코드를 테스트/디버깅하는 것은 종종 단위 테스트를 사용하는 것만 큼 유용합니다. ** 그리고 ** 세 번째 패키지 인 경우가 있습니다. 내 경우 xgboostExplainer (https://medium.com/applied-data-science/new-r-package-the-xgboost-explainer-51dd7d1aa211)에는 사전 처리 된 교육 데이터가 필요합니다. – notiv
사용자 정의 PreprocessingWrappers (http://mlr-org.github.io/mlr-tutorial/devel/html/preproc/index.html#preprocessing-wrapper-functions)를 작성한 경우 전역 환경에 물건을 저장할 수 있습니다 (< <-) 또는 기차에서 디스크에 물건을 쓰고 기능을 예측하십시오. –
감사합니다. @jakobr, 실제로 좋은 팁입니다! – notiv