PartialDependence categorical not working with missings

### Describe the bug

Since version 1.2, the partial dependence plot can deal with categorical features - fantastic! We encountered a small but annoying issue when there are missing values in the categoricals:

- Missing values in numeric features are handled, but not shown (okay)
- Missing values in categoricals raise an error

### Steps/Code to Reproduce

```python
# Make data

from sklearn import datasets
import pandas as pd

iris, Species = datasets.load_iris(return_X_y=True)
iris = pd.DataFrame(
    iris, 
    columns=["sepal_length", "sepal_width", "petal_length", "petal_width"]
)
iris["species"] = pd.Series(Species).map({0: "A", 1: "B", 2: "C"})
iris.head()


# Add some missing values

import numpy as np

iris.loc[0:5, "sepal_width"] = np.nan
iris.loc[0:5, "species"] = np.nan


# Make model

from sklearn.impute import SimpleImputer
from sklearn.preprocessing import OneHotEncoder
from sklearn.linear_model import LinearRegression
from sklearn.compose import ColumnTransformer
from sklearn.pipeline import make_pipeline

species_encoder = make_pipeline(
    SimpleImputer(strategy="constant", fill_value="A"),
    OneHotEncoder(drop=["A"], sparse_output=False)
)

preprocessor = ColumnTransformer(
    transformers=[
        ("species_encoder", species_encoder, ["species"]),
        ("other", SimpleImputer(), ["sepal_width", "petal_width", "petal_length"])
    ],
    verbose_feature_names_out=False
).set_output(transform="pandas")

model = make_pipeline(preprocessor, LinearRegression())

model.fit(iris, iris.sepal_length)


# Inspect

from sklearn.inspection import PartialDependenceDisplay

_ = PartialDependenceDisplay.from_estimator(
    model,
    iris,
    features=["sepal_width", "species"], 
    categorical_features=["species"]
)
```

- A missing value in the numeric feature seems no problem (even if the nan level is not shown in the plot)
- The code works when not adding missing values


### Expected Results

Either a plot without nan level or a plot with separate nan level (might be an option in some fix)

![output](https://user-images.githubusercontent.com/16206095/212533978-a32a3d9e-ea16-4c14-b3cc-2c2abc0998e3.png)


### Actual Results

```pytb
TypeError                                 Traceback (most recent call last)
Cell In [73], line 3
      1 from sklearn.inspection import PartialDependenceDisplay
----> 3 _ = PartialDependenceDisplay.from_estimator(
      4     model,
      5     iris,
      6     features=["sepal_width", "species"], 
      7     categorical_features=["species"]
      8 )

File c:\Users\Michael\anaconda3\envs\ml_lecture\lib\site-packages\sklearn\inspection\_plot\partial_dependence.py:705, in PartialDependenceDisplay.from_estimator(cls, estimator, X, features, categorical_features, feature_names, target, response_method, n_cols, grid_resolution, percentiles, method, n_jobs, verbose, line_kw, ice_lines_kw, pd_line_kw, contour_kw, ax, kind, centered, subsample, random_state)
    699         raise ValueError(
    700             f"When a floating-point, subsample={subsample} should be in "
    701             "the (0, 1) range."
    702         )
    704 # compute predictions and/or averaged predictions
--> 705 pd_results = Parallel(n_jobs=n_jobs, verbose=verbose)(
    706     delayed(partial_dependence)(
    707         estimator,
    708         X,
    709         fxs,
    710         feature_names=feature_names,
    711         categorical_features=categorical_features,
    712         response_method=response_method,
...
--> 336     ar.sort()
    337     aux = ar
    338 mask = np.empty(aux.shape, dtype=np.bool_)

TypeError: '<' not supported between instances of 'str' and 'float'
```

### Versions

```shell
sklearn: 1.2.0
```

COMMENT:
Thank you very much for thinking about this.

- In the numeric case, calculating the grid limits without nan seems like the way to go.
- In the categorical case, we could maybe offer the option `categorical_dropnan=True`. Or is this already a bit too over-engineered?

Labels: Bug