OneHotEncoder `drop_idx_` attribute description in presence of infrequent categories

### Describe the issue linked to the documentation

### Issue summary

In the OneHotEncoder documentation both for [v1.2](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.OneHotEncoder.html#sklearn.preprocessing.OneHotEncoder) and [v1.1](https://scikit-learn.org/1.1/modules/generated/sklearn.preprocessing.OneHotEncoder.html?highlight=one+hot+encoder#sklearn.preprocessing.OneHotEncoder), the description of attribute `drop_idx_` in presence of infrequent categories reads as follows:

> If infrequent categories are enabled by setting `min_frequency` or `max_categories` to a non-default value and `drop_idx[i]` corresponds to a infrequent category, then the entire infrequent category is dropped.`

### User interpretation

My understanding of this description is that when `drop_idx_[i]` corresponds to an infrequent category for column `i`, then the expected encoded column `i_infrequent_sklearn` is dropped. For example, suppose we have the following situation:
```
>>> X = np.array([['a'] * 2 + ['b'] * 4 + ['c'] * 4
...               + ['d'] * 4 + ['e'] * 4], dtype=object).T
>>> enc = preprocessing.OneHotEncoder(min_frequency=4, sparse_output=False, drop='first')
```
Here `X` is a column with five categories where category `a` is considered infrequent. If the above interpretation is correct, then the expected output will consist of four columns, namely, `x0_b`, `x0_c`, `x0_d` and `x0_e`. This is because `a` is both the first category to get dropped due to `drop='first'` as well as an infrequent one. However, the transform output is as follows:
```
>>> Xt = enc.fit_transform(X)
>>> pd.DataFrame(Xt, columns = enc.get_feature_names_out())
ent_categories_
    x0_c  x0_d  x0_e  x0_infrequent_sklearn
0    0.0   0.0   0.0                    1.0
1    0.0   0.0   0.0                    1.0
2    0.0   0.0   0.0                    0.0
3    0.0   0.0   0.0                    0.0
4    0.0   0.0   0.0                    0.0
5    0.0   0.0   0.0                    0.0
6    1.0   0.0   0.0                    0.0
7    1.0   0.0   0.0                    0.0
8    1.0   0.0   0.0                    0.0
9    1.0   0.0   0.0                    0.0
10   0.0   1.0   0.0                    0.0
11   0.0   1.0   0.0                    0.0
12   0.0   1.0   0.0                    0.0
13   0.0   1.0   0.0                    0.0
14   0.0   0.0   1.0                    0.0
15   0.0   0.0   1.0                    0.0
16   0.0   0.0   1.0                    0.0
17   0.0   0.0   1.0                    0.0
```
This means that category `a` is part of the `x0_infrequent_sklearn` column, which takes the value of `1` when `X=='a'`. Category `b` is dropped, this is expected since the `drop='first'` functionality drops the column indexed `0` and after the `_encode` function is applied, categories are remapped based on their sorting order and infrequent ones are mapped last. Meaning that `'a'->4, 'b'->0, 'c'->1, 'd'->2, 'e'->3. This can be verified by the following objects:
```
>>> enc.categories_
[array(['a', 'b', 'c', 'd', 'e'], dtype=object)]
>>> enc._default_to_infrequent_mappings
[array([4, 0, 1, 2, 3])]
```
Notice how at transform the values of the encoded columns are `0` when `X=='b'`. Finally, columns `x0_c`, `x0_d` and `x0_e` are encoded as expected.

### Suggest a potential alternative/fix

### Correct suggestive description based on what is actually happening.

> If infrequent categories are enabled by setting `min_frequency` or `max_categories` to a non-default value and `drop_idx_[i]` corresponds to a infrequent category, then the "first", i.e., indexed `0`, frequent category is dropped after `_encode` is applied during `_transform`.

COMMENT:
Thank you for opening the issue! In this case, API-wise I think `drop_idx` is defined incorrectly and should be `1` point to `b`, because it is the categorical that is actually dropped. 

There seems to be a bigger issue with how `drop_idx` is defined when there are any infrequent categories. I am looking into a fix.

Labels: Bug, module:preprocessing