R 배깅

Jmnote (토론 | 기여)님의 2020년 5월 8일 (금) 22:56 판 (새 문서: ==개요== ;R bagging ;R 배깅 <source lang='r' run> set.seed(42) # 랜덤값 고정 df = iris library(adabag) model = bagging(Species ~ ., df, mfinal=10 ) options(echo=T) # 모델...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

R bagging
R 배깅
set.seed(42) # 랜덤값 고정
df = iris
library(adabag)
model = bagging(Species ~ ., df, mfinal=10 )

options(echo=T)
# 모델 정보
model$importance

# 시각화
plot(model$trees[[10]])
text(model$trees[[10]])

# 자가 테스트
pred = predict(model, df)
# 분류표
table(pred$class, df$Species)
# 정분류율
sum(pred$class==df$Species)/nrow(df)

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}