Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve assessment of missing classes #2

Open
kadyb opened this issue Mar 4, 2023 · 0 comments
Open

Improve assessment of missing classes #2

kadyb opened this issue Mar 4, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@kadyb
Copy link
Owner

kadyb commented Mar 4, 2023

If the classifier is underfitted (too generalized) then we can't calculate the performance metrics because of the missing class in the prediction. We should improve this aspect in the future as follows: If class can't be predicted, assign it value of -1 and calculate the metrics. Then create a separate attribute with information how many classes are missing. Another problem is the differences in the occurrence of classes in the training and test sets.

Here is the current method:

num_class = length(unique(train$class))
pred_class = predict(model, test[, -1])
if (length(levels(pred_class)) != num_class) {
  accuracy = NA
} else {
  accuracy = accuracy_vec(test$class, pred_class)
}
@kadyb kadyb added the enhancement New feature or request label Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant