BUG Problem when `CalibratedClassifierCV` train contains 2 classes but data contains more

### Describe the bug

In `CalibratedClassifierCV` when a train split contains 2 classes (binary) but the data contains more (>=3) classes, we assume the data is binary:

https://github.com/scikit-learn/scikit-learn/blob/d20e0b9abc4a4798d1fd839db50b19c01723094e/sklearn/calibration.py#L605-L607

and we only end up fitting one calibrator:

https://github.com/scikit-learn/scikit-learn/blob/d20e0b9abc4a4798d1fd839db50b19c01723094e/sklearn/calibration.py#L620-L621

Context: noticed when looking #29545 and trying to update [`test_calibration_less_classes`](https://github.com/scikit-learn/scikit-learn/blob/d20e0b9abc4a4798d1fd839db50b19c01723094e/sklearn/tests/test_calibration.py#L441)

### Steps/Code to Reproduce

```python
import numpy as np

from sklearn.model_selection import KFold
from sklearn.tree import DecisionTreeClassifier
from sklearn.calibration import CalibratedClassifierCV

X = np.random.randn(12, 5)
y = [0, 0, 0, 0] + [1, 1, 1, 1] + [2, 2, 2, 2]
clf = DecisionTreeClassifier(random_state=7)
cal_clf = CalibratedClassifierCV(
    clf, method="sigmoid", cv=KFold(3), ensemble=True
)
cal_clf.fit(X, y)
for i in range(3):
    print(f'Fold: {i}')
    proba = cal_clf.calibrated_classifiers_[i].predict_proba(X)
    print(proba)
```

### Expected Results

Expect proba to be 0 ONLY for the class not present in the train subset.

### Actual Results

```
Fold: 0  # train contains class 1 and 2, we take the first `pos_class_indices` (1) to be the positive class
[[0. 1. 0.]
 [0. 1. 0.]
 [0. 1. 0.]
 [0. 1. 0.]
 [0. 1. 0.]
 [0. 1. 0.]
 [0. 1. 0.]
 [0. 1. 0.]
 [0. 1. 0.]
 [0. 1. 0.]
 [0. 1. 0.]
 [0. 1. 0.]]
Fold: 1  # train contains class 0 and 2, 0 is the first `pos_class_indices`
[[1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]]
Fold: 2  # train contains class 0 and 1, `0` is the first `pos_class_indices`
[[1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]]
```

A reasonable fix is to check when `CalibratedClassifierCV.classes_` is greater than `estimator.classes_` and output both proba and 1 - proba (assuming we can know which class the estimator deemed to be the positive class).

It does raise the question of whether we should warn when this happens..?


### Versions

```shell
Used main
```

COMMENT:
Possible solution:-
1.  Check if CalibratedClassifierCV.classes_ is greater than estimator.classes_ and ensure correct probability outputs.
Potiential code change:-
```
import numpy as np
from sklearn.model_selection import KFold
from sklearn.tree import DecisionTreeClassifier
from sklearn.calibration import CalibratedClassifierCV

class CustomCalibratedClassifierCV(CalibratedClassifierCV):
    def fit(self, X, y):
        super().fit(X, y)
        if len(self.classes_) > len(self.base_estimator_.classes_):
            for calibrated_classifier in self.calibrated_classifiers_:
                if calibrated_classifier.classes_.shape[0] == 2:
                    idx = np.searchsorted(self.classes_, calibrated_classifier.classes_)
                    calibrated_classifier.classes_ = self.classes_
                    calibrated_classifier.calibrated_classifiers_ = [
                        self._build_calibrator(
                            (idx == i).astype(np.float64)
                        ) for i in range(len(self.classes_))
                    ]

X = np.random.randn(12, 5)
y = [0, 0, 0, 0] + [1, 1, 1, 1] + [2, 2, 2, 2]
clf = DecisionTreeClassifier(random_state=7)
cal_clf = CustomCalibratedClassifierCV(
    clf, method="sigmoid", cv=KFold(3), ensemble=True
)
cal_clf.fit(X, y)
for i in range(3):
    print(f'Fold: {i}')
    proba = cal_clf.calibrated_classifiers_[i].predict_proba(X)
    print(proba)
```
Hope this helps, Thanks

Labels: Bug