Clarification and Improvement Suggestions for OrdinalEncoder Input and Output

### Describe the workflow you want to enable


Hi there,

I'm relatively new to working with scikit-learn, and as I delve into it, a couple of aspects of the `OrdinalEncoder` have raised questions for me regarding its functionality and design. I'd appreciate some insights and perhaps a bit of clarification:

1) The output structure of `encoder.categories_` appears as a list of arrays. While I understand this design choice may have its reasons, I find it less intuitive for visualization and exploration purposes. Is there a specific rationale for this structure, and do you have any recommendations or best practices for making the output more user-friendly for visual checks?

```python3
from sklearn.preprocessing import OrdinalEncoder
encoder = OrdinalEncoder()
print(encoder.categories_)
```
the result is:
```python3
[array(el_1, ..., el_n), array...]
```

2) I came across a mention of `encoder.set_output()` in your documentation. It seems to take a single parameter (transform='pandas') to set the output type of the encoder function. Could you provide more details or examples on how this method functions and any additional parameters it might accept?

```python3
from sklearn.preprocessing import OrdinalEncoder
encoder = OrdinalEncoder()
encoder.set_output(transform='pandas')
```


### Describe your proposed solution

1)  It would be more intuitive if the output of `encoder.categories_` were presented as a dictionary mapper, like the following:
```python3
[{key_1:val_1, ..., key_n:val_n}, {key: val...}]
```

Alternatively, providing the option for output as a DataFrame, as demonstrated in the following function:

```python3
def find_mapper(df, enc):
    tmp = df.copy()
    tmp['encoded'] = enc.fit_transform(tmp)
    tmp.drop_duplicates(inplace=True)
    tmp.sort_values('encoded', inplace=True)
    tmp.reset_index(inplace=True)
    tmp.drop(columns=['index'], inplace=True)
    print(tmp)

find_mapper(df=education_col, enc=encoder)

        education  encoded
0            10th      0.0
1            11th      1.0
2            12th      2.0
3         1st-4th      3.0
4         5th-6th      4.0
5         7th-8th      5.0
6             9th      6.0
7      Assoc-acdm      7.0
8       Assoc-voc      8.0
9       Bachelors      9.0
10      Doctorate     10.0
11        HS-grad     11.0
12        Masters     12.0
13      Preschool     13.0
14    Prof-school     14.0
15   Some-college     15.0
```

2)  It would be beneficial if the output format could be defined directly in the main input function, enhancing ease of use. For example:

```python3
encoder = OrdinalEncoder(set_output='pandas')
```

I believe these enhancements could contribute to a more user-friendly experience with OrdinalEncoder. Your consideration and feedback on these suggestions would be greatly appreciated.

Thank you!

### Describe alternatives you've considered, if relevant

_No response_

### Additional context

_No response_

COMMENT:
It's quite easy to build the inverse map from the `categories` attribute:

```python
>>> import numpy as np
>>> import pandas as pd
>>> from sklearn.preprocessing import OrdinalEncoder
>>> oe = OrdinalEncoder()
>>> X = pd.DataFrame({"feature_0": np.random.choice(["a", "b", "c"], size=10)})
>>> X
  feature_0
0         b
1         c
2         a
3         b
4         b
5         a
6         c
7         c
8         b
9         a
>>> X_trans = oe.fit_transform(X)
>>> X_trans
array([[1.],
       [2.],
       [0.],
       [1.],
       [1.],
       [0.],
       [2.],
       [2.],
       [1.],
       [0.]])
>>> oe.categories_
[array(['a', 'b', 'c'], dtype=object)]
>>> reverse_map = {cat_label: float(idx) for idx, cat_label in enumerate(oe.categories_[0])}
>>> reverse_map
{'a': 0., 'b': 1., 'c': 2.}
```

Furthermore you can also use the transform to `inverse_transform` to go back to the original representation of the data:

```python
>>> oe.inverse_transform(X_trans)
array([['b'],
       ['c'],
       ['a'],
       ['b'],
       ['b'],
       ['a'],
       ['c'],
       ['c'],
       ['b'],
       ['a']], dtype=object)
```

Labels: New Feature