This repository was archived by the owner on Nov 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
This repository was archived by the owner on Nov 23, 2024. It is now read-only.
Missing enum - create an enum from the description #29
Copy link
Copy link
Open
Labels
@enumRelated to the @enum annotationRelated to the @enum annotationbug 🪲Something isn't workingSomething isn't workingmissing annotationAn annotation should have been generated automatically but wasn'tAn annotation should have been generated automatically but wasn't
Description
URL Hash
#/sklearn/sklearn.impute._base/SimpleImputer/__init__/strategy
Expected Annotation Type
@enum
Expected Annotation Inputs
Enum with content:
"mean", "median", "most_frequent", "constant"
Minimal API Data (optional)
Minimal API Data for `sklearn/sklearn.impute._iterative/IterativeImputer/__init__/min_value`
{
"schemaVersion": 1,
"distribution": "scikit-learn",
"package": "sklearn",
"version": "1.1.1",
"modules": [
{
"id": "sklearn/sklearn.impute",
"name": "sklearn.impute",
"imports": [
{
"module": "typing",
"alias": null
}
],
"from_imports": [
{
"module": "sklearn.impute._base",
"declaration": "MissingIndicator",
"alias": null
},
{
"module": "sklearn.impute._base",
"declaration": "SimpleImputer",
"alias": null
},
{
"module": "sklearn.impute._iterative",
"declaration": "IterativeImputer",
"alias": null
},
{
"module": "sklearn.impute._knn",
"declaration": "KNNImputer",
"alias": null
}
],
"classes": [
"sklearn/sklearn.impute._iterative/IterativeImputer"
],
"functions": []
}
],
"classes": [
{
"id": "sklearn/sklearn.impute._iterative/IterativeImputer",
"name": "IterativeImputer",
"qname": "sklearn.impute._iterative.IterativeImputer",
"decorators": [],
"superclasses": [
"_BaseImputer"
],
"methods": [
"sklearn/sklearn.impute._iterative/IterativeImputer/__init__"
],
"is_public": true,
"reexported_by": [
"sklearn/sklearn.impute"
],
"description": "Multivariate imputer that estimates each feature from all the others.\n\nA strategy for imputing missing values by modeling each feature with\nmissing values as a function of other features in a round-robin fashion.\n\nRead more in the :ref:`User Guide <iterative_imputer>`.\n\n.. versionadded:: 0.21\n\n.. note::\n\nThis estimator is still **experimental** for now: the predictions\nand the API might change without any deprecation cycle. To use it,\nyou need to explicitly import `enable_iterative_imputer`::\n\n>>> # explicitly require this experimental feature\n>>> from sklearn.experimental import enable_iterative_imputer # noqa\n>>> # now you can import normally from sklearn.impute\n>>> from sklearn.impute import IterativeImputer",
"docstring": "Multivariate imputer that estimates each feature from all the others.\n\nA strategy for imputing missing values by modeling each feature with\nmissing values as a function of other features in a round-robin fashion.\n\nRead more in the :ref:`User Guide <iterative_imputer>`.\n\n.. versionadded:: 0.21\n\n.. note::\n\n This estimator is still **experimental** for now: the predictions\n and the API might change without any deprecation cycle. To use it,\n you need to explicitly import `enable_iterative_imputer`::\n\n >>> # explicitly require this experimental feature\n >>> from sklearn.experimental import enable_iterative_imputer # noqa\n >>> # now you can import normally from sklearn.impute\n >>> from sklearn.impute import IterativeImputer\n\nParameters\n----------\nestimator : estimator object, default=BayesianRidge()\n The estimator to use at each step of the round-robin imputation.\n If `sample_posterior=True`, the estimator must support\n `return_std` in its `predict` method.\n\nmissing_values : int or np.nan, default=np.nan\n The placeholder for the missing values. All occurrences of\n `missing_values` will be imputed. For pandas' dataframes with\n nullable integer dtypes with missing values, `missing_values`\n should be set to `np.nan`, since `pd.NA` will be converted to `np.nan`.\n\nsample_posterior : bool, default=False\n Whether to sample from the (Gaussian) predictive posterior of the\n fitted estimator for each imputation. Estimator must support\n `return_std` in its `predict` method if set to `True`. Set to\n `True` if using `IterativeImputer` for multiple imputations.\n\nmax_iter : int, default=10\n Maximum number of imputation rounds to perform before returning the\n imputations computed during the final round. A round is a single\n imputation of each feature with missing values. The stopping criterion\n is met once `max(abs(X_t - X_{t-1}))/max(abs(X[known_vals])) < tol`,\n where `X_t` is `X` at iteration `t`. Note that early stopping is only\n applied if `sample_posterior=False`.\n\ntol : float, default=1e-3\n Tolerance of the stopping condition.\n\nn_nearest_features : int, default=None\n Number of other features to use to estimate the missing values of\n each feature column. Nearness between features is measured using\n the absolute correlation coefficient between each feature pair (after\n initial imputation). To ensure coverage of features throughout the\n imputation process, the neighbor features are not necessarily nearest,\n but are drawn with probability proportional to correlation for each\n imputed target feature. Can provide significant speed-up when the\n number of features is huge. If `None`, all features will be used.\n\ninitial_strategy : {'mean', 'median', 'most_frequent', 'constant'}, default='mean'\n Which strategy to use to initialize the missing values. Same as the\n `strategy` parameter in :class:`~sklearn.impute.SimpleImputer`.\n\nimputation_order : {'ascending', 'descending', 'roman', 'arabic', 'random'}, default='ascending'\n The order in which the features will be imputed. Possible values:\n\n - `'ascending'`: From features with fewest missing values to most.\n - `'descending'`: From features with most missing values to fewest.\n - `'roman'`: Left to right.\n - `'arabic'`: Right to left.\n - `'random'`: A random order for each round.\n\nskip_complete : bool, default=False\n If `True` then features with missing values during :meth:`transform`\n which did not have any missing values during :meth:`fit` will be\n imputed with the initial imputation method only. Set to `True` if you\n have many features with no missing values at both :meth:`fit` and\n :meth:`transform` time to save compute.\n\nmin_value : float or array-like of shape (n_features,), default=-np.inf\n Minimum possible imputed value. Broadcast to shape `(n_features,)` if\n scalar. If array-like, expects shape `(n_features,)`, one min value for\n each feature. The default is `-np.inf`.\n\n .. versionchanged:: 0.23\n Added support for array-like.\n\nmax_value : float or array-like of shape (n_features,), default=np.inf\n Maximum possible imputed value. Broadcast to shape `(n_features,)` if\n scalar. If array-like, expects shape `(n_features,)`, one max value for\n each feature. The default is `np.inf`.\n\n .. versionchanged:: 0.23\n Added support for array-like.\n\nverbose : int, default=0\n Verbosity flag, controls the debug messages that are issued\n as functions are evaluated. The higher, the more verbose. Can be 0, 1,\n or 2.\n\nrandom_state : int, RandomState instance or None, default=None\n The seed of the pseudo random number generator to use. Randomizes\n selection of estimator features if `n_nearest_features` is not `None`,\n the `imputation_order` if `random`, and the sampling from posterior if\n `sample_posterior=True`. Use an integer for determinism.\n See :term:`the Glossary <random_state>`.\n\nadd_indicator : bool, default=False\n If `True`, a :class:`MissingIndicator` transform will stack onto output\n of the imputer's transform. This allows a predictive estimator\n to account for missingness despite imputation. If a feature has no\n missing values at fit/train time, the feature won't appear on\n the missing indicator even if there are missing values at\n transform/test time.\n\nAttributes\n----------\ninitial_imputer_ : object of type :class:`~sklearn.impute.SimpleImputer`\n Imputer used to initialize the missing values.\n\nimputation_sequence_ : list of tuples\n Each tuple has `(feat_idx, neighbor_feat_idx, estimator)`, where\n `feat_idx` is the current feature to be imputed,\n `neighbor_feat_idx` is the array of other features used to impute the\n current feature, and `estimator` is the trained estimator used for\n the imputation. Length is `self.n_features_with_missing_ *\n self.n_iter_`.\n\nn_iter_ : int\n Number of iteration rounds that occurred. Will be less than\n `self.max_iter` if early stopping criterion was reached.\n\nn_features_in_ : int\n Number of features seen during :term:`fit`.\n\n .. versionadded:: 0.24\n\nfeature_names_in_ : ndarray of shape (`n_features_in_`,)\n Names of features seen during :term:`fit`. Defined only when `X`\n has feature names that are all strings.\n\n .. versionadded:: 1.0\n\nn_features_with_missing_ : int\n Number of features with missing values.\n\nindicator_ : :class:`~sklearn.impute.MissingIndicator`\n Indicator used to add binary indicators for missing values.\n `None` if `add_indicator=False`.\n\nrandom_state_ : RandomState instance\n RandomState instance that is generated either from a seed, the random\n number generator or by `np.random`.\n\nSee Also\n--------\nSimpleImputer : Univariate imputation of missing values.\n\nNotes\n-----\nTo support imputation in inductive mode we store each feature's estimator\nduring the :meth:`fit` phase, and predict without refitting (in order)\nduring the :meth:`transform` phase.\n\nFeatures which contain all missing values at :meth:`fit` are discarded upon\n:meth:`transform`.\n\nReferences\n----------\n.. [1] `Stef van Buuren, Karin Groothuis-Oudshoorn (2011). \"mice:\n Multivariate Imputation by Chained Equations in R\". Journal of\n Statistical Software 45: 1-67.\n <https://www.jstatsoft.org/article/view/v045i03>`_\n\n.. [2] `S. F. Buck, (1960). \"A Method of Estimation of Missing Values in\n Multivariate Data Suitable for use with an Electronic Computer\".\n Journal of the Royal Statistical Society 22(2): 302-306.\n <https://www.jstor.org/stable/2984099>`_\n\nExamples\n--------\n>>> import numpy as np\n>>> from sklearn.experimental import enable_iterative_imputer\n>>> from sklearn.impute import IterativeImputer\n>>> imp_mean = IterativeImputer(random_state=0)\n>>> imp_mean.fit([[7, 2, 3], [4, np.nan, 6], [10, 5, 9]])\nIterativeImputer(random_state=0)\n>>> X = [[np.nan, 2, 3], [4, np.nan, 6], [10, np.nan, 9]]\n>>> imp_mean.transform(X)\narray([[ 6.9584..., 2. , 3. ],\n [ 4. , 2.6000..., 6. ],\n [10. , 4.9999..., 9. ]])"
}
],
"functions": [
{
"id": "sklearn/sklearn.impute._iterative/IterativeImputer/__init__",
"name": "__init__",
"qname": "sklearn.impute._iterative.IterativeImputer.__init__",
"decorators": [],
"parameters": [
{
"id": "sklearn/sklearn.impute._iterative/IterativeImputer/__init__/min_value",
"name": "min_value",
"qname": "sklearn.impute._iterative.IterativeImputer.__init__.min_value",
"default_value": "-np.inf",
"assigned_by": "NAME_ONLY",
"is_public": true,
"docstring": {
"type": "float or array-like of shape (n_features,)",
"description": "Minimum possible imputed value. Broadcast to shape `(n_features,)` if\nscalar. If array-like, expects shape `(n_features,)`, one min value for\neach feature. The default is `-np.inf`.\n\n.. versionchanged:: 0.23\nAdded support for array-like."
},
"type": {}
}
],
"results": [],
"is_public": true,
"reexported_by": [],
"description": "Multivariate imputer that estimates each feature from all the others.\n\nA strategy for imputing missing values by modeling each feature with\nmissing values as a function of other features in a round-robin fashion.\n\nRead more in the :ref:`User Guide <iterative_imputer>`.\n\n.. versionadded:: 0.21\n\n.. note::\n\nThis estimator is still **experimental** for now: the predictions\nand the API might change without any deprecation cycle. To use it,\nyou need to explicitly import `enable_iterative_imputer`::\n\n>>> # explicitly require this experimental feature\n>>> from sklearn.experimental import enable_iterative_imputer # noqa\n>>> # now you can import normally from sklearn.impute\n>>> from sklearn.impute import IterativeImputer",
"docstring": ""
}
]
}Minimal Usage Store (optional)
Minimal Usage Store for `sklearn/sklearn.impute._iterative/IterativeImputer/__init__/min_value`
{
"schemaVersion": 1,
"module_counts": {
"sklearn/sklearn.impute": 1924
},
"class_counts": {
"sklearn/sklearn.impute._iterative/IterativeImputer": 130
},
"function_counts": {
"sklearn/sklearn.impute._iterative/IterativeImputer/__init__": 55
},
"parameter_counts": {
"sklearn/sklearn.impute._iterative/IterativeImputer/__init__/min_value": 5
},
"value_counts": {
"sklearn/sklearn.impute._iterative/IterativeImputer/__init__/min_value": {
"0": 1,
"1": 4,
"-np.inf": 50
}
}
}Suggested Solution (optional)
Parse text segments with "- If..."
Additional Context (optional)
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@enumRelated to the @enum annotationRelated to the @enum annotationbug 🪲Something isn't workingSomething isn't workingmissing annotationAn annotation should have been generated automatically but wasn'tAn annotation should have been generated automatically but wasn't
Type
Projects
Status
Backlog