I am doing a binomial classification. How can I put more weightage on a particular class?

I am doing a binomial classification(frauds & non frauds). How can I put more weightage on a particular class?

I want to put more weightage on frauds so that I can capture more frauds compared to non frauds.

How to do this, please help.

You mean binary classification, correct?

Some classifiers have the ability to put weights for training examples.

Otherwise it would mostly help if you just duplicate the training examples which you want to “emphasize”, or remove some samples from the complementary class. However, this way you’re losing probably valuable information. A very simple approach is using “equal sampling” using the corresponding node:

At the end, I would address this differently though: Use the prediction probability to favor negative or positive outcomes (i.e. do not use the default threshold of 0.5, but something larger/smaller than that). If you want to see F1/Pr/Rc/Accuracy of your classifier at different thresholds, you can use e.g. this node from the Palladian toolkit:

Hope this helps!

–Philipp

3 Likes

I would also add SMOTE which is another way KNIME can deal with imbalanced data.

Binary Classification Inspection node is also neat for looking at threshold and different metrics interactively.

We recently made some improvements to the XGBoost node in KNIME 4.6 to help with exactly this scenario:

Check it out in action in this example workflow: