predict_da.Rd
범주별 판별함수를 이용하여 새 데이터에 대한 범주를 예측한다.
predict_da( .f, .new_data, .xvar, .include_score = FALSE, .include_posterior = FALSE, .include_class = TRUE )
.f | 판별함수 리스트. |
---|---|
.new_data | 새 관측 데이터 프레임. |
.xvar | 범주 분류에 사용될 변수. |
.include_score | TRUE이면 범주별 판별함수값을 결과에 저장. default = FALSE. |
.include_posterior | TRUE이면 사후확률값을 결과에 저장. default = FALSE. |
.include_class | TRUE이면 추정범주값을 결과에 저장. default = TRUE. |
데이터 프레임: 범주 추정.
data(binaryclass2, package = "dmtr") f <- ld_fun(binaryclass2, class, c(x1, x2)) predict_da(f, binaryclass2, c(x1, x2), .include_posterior = TRUE)#> # A tibble: 9 × 3 #> .pred_1 .pred_2 .pred_class #> <dbl> <dbl> <fct> #> 1 0.903 0.0968 1 #> 2 0.0812 0.919 2 #> 3 0.681 0.319 1 #> 4 0.0212 0.979 2 #> 5 0.976 0.0239 1 #> 6 0.975 0.0247 1 #> 7 0.307 0.693 2 #> 8 0.00477 0.995 2 #> 9 0.0838 0.916 2