Ordinal encoding replaces each category with an integer. It is only suitable when there is a natural order (low, medium, high), which you must then specify with the categories parameter. On categories with no order, it introduces an artificial order that misleads linear models.
Example
OrdinalEncoder(categories=[['faible', 'moyen', 'élevé']])