---
id: 17515
lang: en
title: "Scoring Ensemble Subtracts the Second Model: Weights of 1.34 and −0.34 Cancel Out Shared Errors"
published_at: "2026-11-21 02:18:26"
source_name: "Хабр: Машинное обучение"
source_url: "https://habr.com/ru/companies/alfa/articles/1108082/?utm_campaign=1108082&utm_source=habrahabr&utm_medium=rss"
canonical_url: "https://news.hamidun.com/en/news/17515"
categories: ["research", "business"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# Scoring Ensemble Subtracts the Second Model: Weights of 1.34 and −0.34 Cancel Out Shared Errors

> **Краткая суть (BLUF):** If an optimizer combining two credit scoring models returns weights of 1.34 and −0.34, the second model's prediction is subtracted rather than added. That is not always a bug. If both models make errors on the same borrowers, subtracting the second one cancels the shared part of the error, much like a short position hedges a stock portfolio. Such stacking is worth trying, but it should be validated on new data.  • The author tests the idea on 18 scoring models using open auto loan data • Risk: overly similar predictions make the weights unstable • The final probability may fall outside the 0-to-1 range

You have trained two credit scoring models and want to combine their predictions into a single probability of default. The usual approach is to give each model a positive weight so the weights sum to one. But the optimizer sometimes returns weights of 1.34 and −0.34. That means the final prediction is calculated as follows: the first model's prediction is multiplied by 1.34, and a third (0.34) of the second model's prediction is subtracted from the result. It looks strange: why keep in the ensemble a model that gets subtracted? Credit risk analyst Ivan explained on Habr why such a result can be entirely rational, and compared different ways of selecting weights.

## A short position as insurance

The idea is easiest to understand through a financial example. An investor has 1 million rubles and wants to buy shares of company A worth 1.2 million. He covers the missing 200 thousand by borrowing shares of company B from a broker and selling them, promising to buy them back and return them later. The asset weights come out to 1.2 and −0.2, and they still sum to one.

If both stocks react to the same adverse factor, the drop in A is partly offset by the profit on B: it can be bought back more cheaply and returned to the broker. This kind of insurance is called hedging. The investor does not consider stock B to be bad. He simply offsets a common source of risk.

The same logic applies to an ensemble. Suppose two scoring models make errors on the same borrowers, and the second one expresses this shared error more strongly. If part of its prediction is subtracted, the common component is removed from the final estimate. Therefore a negative weight does not mean the model is weak. What matters is how its errors relate to the errors of the other models, not only its own accuracy.

## Three ways to select weights

The author compares three formulations. In the first, the weights are free: this is ordinary linear regression that minimizes the Brier score, that is, the mean squared error of the predicted default probability. In the second, the weights are non-negative and sum to one (in finance this is called long-only). In the third, a weight can have either sign while the sum remains equal to one (long-short).

For the third case there is an analytical solution using the Lagrange method. Its structure matches the weights of the Markowitz minimum-variance portfolio, except that the matrix of second moments of the errors is used instead of the covariance matrix of returns. It accounts both for how the model errors move together and for their systematic bias.

For two models, the weight of the second becomes negative when the numerator in the formula for the optimal coefficient changes sign. From this the author concludes that negative weights are not necessarily a sign of overfitting. With a certain error structure, they are optimal from the standpoint of the Brier score.

## Risks and validation

Flexibility comes at a cost, and the author names three problems:

- the final prediction may fall outside the 0-to-1 bounds;
- if the base model predictions are nearly identical, the error matrix is close to singular and the weights become unstable;
- on training data, removing the constraint will not worsen the Brier score, but on new data the gain is not guaranteed.

To test this, Ivan used the open L&T Vehicle Loan Default Prediction dataset, which contains auto loan data with both default and non-default cases. He builds 18 scoring models and compares the quality and stability of different weight-selection methods. The author separately wants to show that negative weights improve the ensemble and to check how stable they are. He also promises to cover methods that limit the size of the coefficients without fully prohibiting negative signs.

## What to take away

Do not discard stacking with negative weights just because "it shouldn't work that way." But select the weights using out-of-fold predictions, that is, predictions on data the model did not see during training. Then compare long-only and long-short on a holdout sample, ideally split by time. Monitor the correlation of predictions and how the weights change from run to run. Clip the final probability to the 0-to-1 range. If the weights "jump around," add regularization: it preserves the ability to hedge errors but keeps the weights from growing without bound.

The limitation of this material is obvious: it is the analyst's own work, not an ML engineer's, and it rests on a single open dataset. It is a good working hypothesis and a reason to test your own ensemble, but not a universal rule.

---
- **Первоисточник:** [Хабр: Машинное обучение](https://habr.com/ru/companies/alfa/articles/1108082/?utm_campaign=1108082&utm_source=habrahabr&utm_medium=rss)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/17515
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
