목록r (3)
김두두의 블로그
?boosting.cv를 이용해 알아봤다. Description: The data are divided into v non-overlapping subsets of roughly equal size. Then, boosting is applied on (v-1) of the subsets. Finally, predictions are made for the left our subsets, and the process is repeated for each of the v sets. v-fold cross validation을 하고 boosting에 v-1개의 하위집합으로 적용시킨다는 뜻인 듯 하다. (찾아보니 아주 잘 설명된 블로그가 나왔다!!) boosting과 bagging은 모두 ensemble me..
adaboost를 사용하기 위해선 C50 패키지와 adabag 패키지가 필요하다. C50 package: C5.0 decision trees and rule-based models for pattern recognition that extend the work of Quinlan (출처: https://cran.r-project.org/web/packages/C50/index.html) 실질적으로 adaboost를 하는 건 adabag패키지인 것 같다. 하여튼! library('C50') library('adabag') iris.adaboost iris.adaboost=boosting(iris$Species~.,data=iris) Error in `[.data.frame`(data, , as.charac..

bagging함수는 ipred 패키지안에 있다. ?bagging을 하면 bagging의 description이 나오는데, 대부분 파일 형태가 data.frame일 것이므로 데이터프레임에 대해서만 다뤄보도록 하자. 데이터가 어떤 형태인지 알고 싶다면 str()을 해주면 간단하게 나온다. 사진의 맨 마지막 줄을 보면, S3 method for class 'data.frame' 의 경우엔 bagging(formula, data, subset, na.action=na.rpart,...) 의 명령어를 이용하라고 나온다. (우리가 주로 다루는 데이터 form들은 주로 S3 class이다. S4는 내가 공부 더하고 추가해야지..😉) 이 때 formula란 무엇일까? a formula of the form lhs~rh..