9
$\begingroup$

I have a binary classification (supervised learning) problem, where all my features are boolean, with the following twist: I want to learn a classifier $f:\{0,1\}^n \to \{0,1\}$ that is monotone. In other words, changing any subset of features from 0 to 1 should never change the output of the classifier from 1 to 0.

How can I learn a monotone classifier? Can I adapt standard classification methods somehow, to enforce the monotonicity constraint?

I can see how to adapt logistic regression in a way that ensures it will learn a monotonic model: we can require that each feature's coefficient be non-negative, and then apply a constrained optimization algorithm to infer the coefficients of the model. Is there a reasonable way to adapt other supervised learning schemes (e.g., random forests, gradient boosting, neural networks)? Or are there dedicated algorithms that are appropriate for this situation?


Unfortunately just applying a standard random forests classifier is not guaranteed to yield a monotone classifier, even if the training set is monotone (it comes from a monotone setting, and has no noise or violations of monotonicity). See https://cs.stackexchange.com/q/69220/755 for an explicit example, i.e., an example of a monotone training set, where random forests might learn a non-monotone classifier -- even though there exists a monotone classifier that is equally good. This suggests that we might need some more sophisticated technique if we want to learn a monotone classifier.

$\endgroup$
4
  • 1
    $\begingroup$ Just a question: do your data come from a monotone settings or do they also contain some counter examples? If there would be no counter examples, then e.g. random forests shall work fine. If there are some, you could simply remove them from the training set. $\endgroup$ Commented Jan 19, 2017 at 0:42
  • $\begingroup$ @KarelMacek, cool! Since I'm looking for an entry point into the literature or into techniques, I'm fine with assuming the data in the training set is all monotone. Is it guaranteed that a random forests classifier trained on a monotone data set will yield a monotone classifier? $\endgroup$
    – D.W.
    Commented Jan 19, 2017 at 1:06
  • $\begingroup$ @KarelMacek, thanks for the suggestion! Unfortunately it looks like just applying standard random forests can fail -- see last paragraph of edited question for explanation and a link to an explicit example. It's not evident to me how to repair the problem. Any ideas? $\endgroup$
    – D.W.
    Commented Jan 24, 2017 at 2:56
  • 3
    $\begingroup$ A MLP neural network with weights greater than or equal to 1 and nondecreasing, nonnegative activation functions (e.g. ReLU) satisfies the monotonicity requirement. This is because the sums of nonnegative numbers are nonnegative, and a positive number $p$ multiplied by a number greater than 1 is larger than $p$. $\endgroup$
    – Sycorax
    Commented Jan 24, 2017 at 3:56

2 Answers 2

3
$\begingroup$

While it's an old question, I have just found that gradient boosted trees support such functionality and it is already implemented with at XGBoost. Check here for more details

$\endgroup$
3
$\begingroup$

You can always constrain a neural network to be monotonic by constraining the weights to be positive and using monotonic activations as discussed here. See here for a practical tutorial with an open source implementation.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.