Description Usage Arguments Value Reference See Also Examples
Classifies observations based on a given abcrlda object.
1 2 |
object |
An object of class "abcrlda". |
newx |
Matrix of new values for x at which predictions are to be made. |
... |
Argument used by generic function predict(object, x, ...). |
Returns factor vector with predictions (i.e., assigned labels) for each observation. Factor levels are inherited from the object variable.
A. Zollanvari, M. Abdirash, A. Dadlani and B. Abibullaev, "Asymptotically Bias-Corrected Regularized Linear Discriminant Analysis for Cost-Sensitive Binary Classification," in IEEE Signal Processing Letters, vol. 26, no. 9, pp. 1300-1304, Sept. 2019. doi: 10.1109/LSP.2019.2918485 URL: https://ieeexplore.ieee.org/document/8720003
Other functions in the package:
abcrlda()
,
cross_validation()
,
da_risk_estimator()
,
grid_search()
,
risk_calculate()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | data(iris)
train_data <- iris[which(iris[, ncol(iris)] == "virginica" |
iris[, ncol(iris)] == "versicolor"), 1:4]
train_label <- factor(iris[which(iris[, ncol(iris)] == "virginica" |
iris[, ncol(iris)] == "versicolor"), 5])
model <- abcrlda(train_data, train_label, gamma = 0.5, cost = 0.75)
a <- predict(model, train_data)
# same params but more explicit
model <- abcrlda(train_data, train_label, gamma = 0.5, cost = c(0.75, 0.25))
b <- predict(model, train_data)
# same class costs ratio
model <- abcrlda(train_data, train_label, gamma = 0.5, cost = c(3, 1))
c <- predict(model, train_data)
# all this model will give the same predictions
all(a == b & a == c & b == c)
#' [1] TRUE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.