Flow
TESTa5247d2203sklearn.preprocessing._encoders.OrdinalEncoder

TESTa5247d2203sklearn.preprocessing._encoders.OrdinalEncoder

Visibility: public Uploaded 17-10-2024 by Continuous Integration sklearn==1.3.2 numpy>=1.17.3 scipy>=1.5.0 joblib>=1.1.1 threadpoolctl>=2.0.0 0 runs
0 likes downloaded by 0 people 0 issues 0 downvotes , 0 total downloads
  • openml-python python scikit-learn sklearn sklearn_1.3.2
Issue #Downvotes for this reason By


Loading wiki
Help us complete this description Edit
Encode categorical features as an integer array. The input to this transformer should be an array-like of integers or strings, denoting the values taken on by categorical (discrete) features. The features are converted to ordinal integers. This results in a single column of integers (0 to n_categories - 1) per feature.

Parameters

categoriesCategories (unique values) per feature: - 'auto' : Determine categories automatically from the training data - list : ``categories[i]`` holds the categories expected in the ith column. The passed categories should not mix strings and numeric values, and should be sorted in case of numeric values The used categories can be found in the ``categories_`` attributedefault: [[0, 1], [0, 1]]
dtypeDesired dtype of output handle_unknown : {'error', 'use_encoded_value'}, default='error' When set to 'error' an error will be raised in case an unknown categorical feature is present during transform. When set to 'use_encoded_value', the encoded value of unknown categories will be set to the value given for the parameter `unknown_value`. In :meth:`inverse_transform`, an unknown category will be denoted as None .. versionadded:: 0.24default: {"oml-python:serialized_object": "type", "value": "np.float64"}
encoded_missing_valueEncoded value of missing categories. If set to `np.nan`, then the `dtype` parameter must be a float dtype .. versionadded:: 1.1default: NaN
handle_unknowndefault: "error"
max_categoriesSpecifies an upper limit to the number of output categories for each input feature when considering infrequent categories. If there are infrequent categories, `max_categories` includes the category representing the infrequent categories along with the frequent categories. If `None`, there is no limit to the number of output features `max_categories` do **not** take into account missing or unknown categories. Setting `unknown_value` or `encoded_missing_value` to an integer will increase the number of unique integer codes by one each This can result in up to `max_categories + 2` integer codes .. versionadded:: 1.3 Read more in the :ref:`User Guide `.default: null
min_frequencySpecifies the minimum frequency below which a category will be considered infrequent - If `int`, categories with a smaller cardinality will be considered infrequent - If `float`, categories with a smaller cardinality than `min_frequency * n_samples` will be considered infrequent .. versionadded:: 1.3 Read more in the :ref:`User Guide `default: null
unknown_valueWhen the parameter handle_unknown is set to 'use_encoded_value', this parameter is required and will set the encoded value of unknown categories. It has to be distinct from the values used to encode any of the categories in `fit`. If set to np.nan, the `dtype` parameter must be a float dtype .. versionadded:: 0.24default: null

0
Runs

List all runs
Parameter:
Rendering chart
Rendering table