Error in impute/_base.py _most_frequent when array contains None

### Describe the bug

TypeError: '<' not supported between instances of 'NoneType' and 'str'
when calculating min in impute/_base.py

most_frequent_value = min(
                value
                for value, count in counter.items()
                if count == most_frequent_count
            )

when array has None value as the most frequent one.

### Steps/Code to Reproduce

array = numpy.array(['a','b',None,None])

### Expected Results

most frequent: 'a'
imputed array: ['a','b','a','a']

### Actual Results

TypeError: '<' not supported between instances of 'NoneType' and 'str'

COMMENT:
fixed by changing two lines:

    #if array.size > 0:
    if np.array([a for a in array if a is not None]).size > 0:

           #counter = Counter(array)
            counter = Counter([a for a in array if a is not None])


### Versions

```shell
System:
    python: 3.12.3 (main, Nov  6 2024, 18:32:19) [GCC 13.2.0]
executable: /home/padiadev/venv/bin/python
   machine: Linux-6.8.0-45-generic-x86_64-with-glibc2.39

Python dependencies:
      sklearn: 1.5.2
          pip: 24.0
   setuptools: None
        numpy: 1.26.4
        scipy: 1.14.1
       Cython: None
       pandas: 2.2.3
   matplotlib: 3.9.2
       joblib: 1.4.2
threadpoolctl: 3.5.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 2
         prefix: libopenblas
       filepath: /home/padiadev/venv/lib/python3.12/site-packages/numpy.libs/libopenblas64_p-r0-0cf96a72.3.23.dev.so
        version: 0.3.23.dev
threading_layer: pthreads
   architecture: Haswell

       user_api: blas
   internal_api: openblas
    num_threads: 2
         prefix: libscipy_openblas
       filepath: /home/padiadev/venv/lib/python3.12/site-packages/scipy.libs/libscipy_openblas-c128ec02.so
        version: 0.3.27.dev
threading_layer: pthreads
   architecture: Haswell

       user_api: openmp
   internal_api: openmp
    num_threads: 2
         prefix: libgomp
       filepath: /home/padiadev/venv/lib/python3.12/site-packages/scikit_learn.libs/libgomp-a34b3233.so.1.0.0
        version: None
```

COMMENT:
Fixed by specifying missing_values=None. Thank you.

The default missing_values=nan produced this unexpected result:
  

> File "/ai4db/dev/ai4db.py", line 356, in preprocess
>     return transformer.fit_transform(df)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/sklearn/utils/_set_output.py", line 316, in wrapped
>     data_to_wrap = f(self, X, *args, **kwargs)
>                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/sklearn/base.py", line 1473, in wrapper
>     return fit_method(estimator, *args, **kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/sklearn/compose/_column_transformer.py", line 976, in fit_transform
>     result = self._call_func_on_transformers(
>              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/sklearn/compose/_column_transformer.py", line 885, in _call_func_on_transformers
>     return Parallel(n_jobs=self.n_jobs)(jobs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/sklearn/utils/parallel.py", line 74, in __call__
>     return super().__call__(iterable_with_config)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/joblib/parallel.py", line 1918, in __call__
>     return output if self.return_generator else list(output)
>                                                 ^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/joblib/parallel.py", line 1847, in _get_sequential_output
>     res = func(*args, **kwargs)
>           ^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/sklearn/utils/parallel.py", line 136, in __call__
>     return self.function(*args, **kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/sklearn/pipeline.py", line 1310, in _fit_transform_one
>     res = transformer.fit_transform(X, y, **params.get("fit_transform", {}))
>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/sklearn/base.py", line 1473, in wrapper
>     return fit_method(estimator, *args, **kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/sklearn/pipeline.py", line 533, in fit_transform
>     Xt = self._fit(X, y, routed_params)
>          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/sklearn/pipeline.py", line 406, in _fit
>     X, fitted_transformer = fit_transform_one_cached(
>                             ^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/joblib/memory.py", line 312, in __call__
>     return self.func(*args, **kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/sklearn/pipeline.py", line 1310, in _fit_transform_one
>     res = transformer.fit_transform(X, y, **params.get("fit_transform", {}))
>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/sklearn/utils/_set_output.py", line 316, in wrapped
>     data_to_wrap = f(self, X, *args, **kwargs)
>                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/sklearn/base.py", line 1098, in fit_transform
>     return self.fit(X, **fit_params).transform(X)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/sklearn/base.py", line 1473, in wrapper
>     return fit_method(estimator, *args, **kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/sklearn/impute/_base.py", line 440, in fit
>     self.statistics_ = self._dense_fit(
>                        ^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/sklearn/impute/_base.py", line 539, in _dense_fit
>     most_frequent[i] = _most_frequent(row, np.nan, 0)
>                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/padiadev/venv/lib/python3.12/site-packages/sklearn/impute/_base.py", line 50, in _most_frequent
>     most_frequent_value = min(
>                           ^^^^
> TypeError: '<' not supported between instances of 'NoneType' and 'str'

Labels: Bug, Needs Triage