Scoring Ensemble Subtracts the Second Model: Weights of 1.34 and −0.34 Cancel Out Shared Errors
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.
AI-processed from Хабр: Машинное обучение; edited by Hamidun News
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.
- Nov 8, 2026Ensemble distillation on Kaggle: one model beat its teacher and saved 6.5 hours
- Nov 21, 2026Credit Scoring: 500 Defaults Give the Same Quality at 2,000 and 50,000 Applications
- Oct 9, 2026PANTHER: AIRI student project wins FLARE 2026, finding tumors in 11 seconds
- Oct 12, 2026U4RASD Takes 1st Place at KnowledgeGraphEval-2026: 94.06 micro-F1 on Arabic
Key Questions Answered
What are the key details on 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.
What are the key details on 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.
What are the key details on 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.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
