`L i6ddlZddlmZddlmZmZddlmZddlZddl m Z ddl m Z m Z ddlmZdd lmZdd lmZmZmZdd lmZdd lmZdd lmZddlmZmZmZddl m!Z!m"Z"m#Z#m$Z$ddl%m&Z&m'Z'm(Z(m)Z)m*Z*ddl+m,Z,m-Z-m.Z.edgdZ/dZ0Gdde-Z1y)N) namedtuple)IntegralReal)time)stats) _fit_contextclone)ConvergenceWarning) normalize)_safe_indexing check_arraycheck_random_state) _safe_assign) _get_mask) is_scalar_nan) HasMethodsInterval StrOptions)MetadataRouter MethodMapping_raise_for_paramsprocess_routing) FLOAT_DTYPES_check_feature_names_in _num_samplescheck_is_fitted validate_data) SimpleImputer _BaseImputer_check_inputs_dtype_ImputerTriplet)feat_idxneighbor_feat_idx estimatorcVt|dr|j||dy||||<y)a>Assign X2 to X1 where cond is True. Parameters ---------- X1 : ndarray or dataframe of shape (n_samples, n_features) Data. X2 : ndarray of shape (n_samples, n_features) Data to be assigned. cond : ndarray of shape (n_samples, n_features) Boolean mask to assign data. maskT)condotherinplaceN)hasattrr()X1X2r)s _/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sklearn/impute/_iterative.py _assign_wherer0(s-r6 TT2d84ceZdZUdZiej deddggdgeedddgee dddgdeed ddge hd gd e hd gdgdee ddd dgdee ddd dgdgdgd Ze e d< d&e jdddddddde j e jdddddfd Z d'dZdZdZd(dZd)dZedZed d&fd! Zfd"Zd&d#Zd&d$Zd%ZxZS)*IterativeImputera}(Multivariate imputer that estimates each feature from all the others. A strategy for imputing missing values by modeling each feature with missing values as a function of other features in a round-robin fashion. Read more in the :ref:`User Guide `. .. versionadded:: 0.21 .. note:: This estimator is still **experimental** for now: the predictions and the API might change without any deprecation cycle. To use it, you need to explicitly import `enable_iterative_imputer`:: >>> # explicitly require this experimental feature >>> from sklearn.experimental import enable_iterative_imputer # noqa >>> # now you can import normally from sklearn.impute >>> from sklearn.impute import IterativeImputer Parameters ---------- estimator : estimator object, default=BayesianRidge() The estimator to use at each step of the round-robin imputation. If `sample_posterior=True`, the estimator must support `return_std` in its `predict` method. missing_values : int or np.nan, default=np.nan The placeholder for the missing values. All occurrences of `missing_values` will be imputed. For pandas' dataframes with nullable integer dtypes with missing values, `missing_values` should be set to `np.nan`, since `pd.NA` will be converted to `np.nan`. sample_posterior : bool, default=False Whether to sample from the (Gaussian) predictive posterior of the fitted estimator for each imputation. Estimator must support `return_std` in its `predict` method if set to `True`. Set to `True` if using `IterativeImputer` for multiple imputations. max_iter : int, default=10 Maximum number of imputation rounds to perform before returning the imputations computed during the final round. A round is a single imputation of each feature with missing values. The stopping criterion is met once `max(abs(X_t - X_{t-1}))/max(abs(X[known_vals])) < tol`, where `X_t` is `X` at iteration `t`. Note that early stopping is only applied if `sample_posterior=False`. tol : float, default=1e-3 Tolerance of the stopping condition. n_nearest_features : int, default=None Number of other features to use to estimate the missing values of each feature column. Nearness between features is measured using the absolute correlation coefficient between each feature pair (after initial imputation). To ensure coverage of features throughout the imputation process, the neighbor features are not necessarily nearest, but are drawn with probability proportional to correlation for each imputed target feature. Can provide significant speed-up when the number of features is huge. If `None`, all features will be used. initial_strategy : {'mean', 'median', 'most_frequent', 'constant'}, default='mean' Which strategy to use to initialize the missing values. Same as the `strategy` parameter in :class:`~sklearn.impute.SimpleImputer`. fill_value : str or numerical value, default=None When `strategy="constant"`, `fill_value` is used to replace all occurrences of missing_values. For string or object data types, `fill_value` must be a string. If `None`, `fill_value` will be 0 when imputing numerical data and "missing_value" for strings or object data types. .. versionadded:: 1.3 imputation_order : {'ascending', 'descending', 'roman', 'arabic', 'random'}, default='ascending' The order in which the features will be imputed. Possible values: - `'ascending'`: From features with fewest missing values to most. - `'descending'`: From features with most missing values to fewest. - `'roman'`: Left to right. - `'arabic'`: Right to left. - `'random'`: A random order for each round. skip_complete : bool, default=False If `True` then features with missing values during :meth:`transform` which did not have any missing values during :meth:`fit` will be imputed with the initial imputation method only. Set to `True` if you have many features with no missing values at both :meth:`fit` and :meth:`transform` time to save compute. min_value : float or array-like of shape (n_features,), default=-np.inf Minimum possible imputed value. Broadcast to shape `(n_features,)` if scalar. If array-like, expects shape `(n_features,)`, one min value for each feature. The default is `-np.inf`. .. versionchanged:: 0.23 Added support for array-like. max_value : float or array-like of shape (n_features,), default=np.inf Maximum possible imputed value. Broadcast to shape `(n_features,)` if scalar. If array-like, expects shape `(n_features,)`, one max value for each feature. The default is `np.inf`. .. versionchanged:: 0.23 Added support for array-like. verbose : int, default=0 Verbosity flag, controls the debug messages that are issued as functions are evaluated. The higher, the more verbose. Can be 0, 1, or 2. random_state : int, RandomState instance or None, default=None The seed of the pseudo random number generator to use. Randomizes selection of estimator features if `n_nearest_features` is not `None`, the `imputation_order` if `random`, and the sampling from posterior if `sample_posterior=True`. Use an integer for determinism. See :term:`the Glossary `. add_indicator : bool, default=False If `True`, a :class:`MissingIndicator` transform will stack onto output of the imputer's transform. This allows a predictive estimator to account for missingness despite imputation. If a feature has no missing values at fit/train time, the feature won't appear on the missing indicator even if there are missing values at transform/test time. keep_empty_features : bool, default=False If True, features that consist exclusively of missing values when `fit` is called are returned in results when `transform` is called. The imputed value is always `0` except when `initial_strategy="constant"` in which case `fill_value` will be used instead. .. versionadded:: 1.2 Attributes ---------- initial_imputer_ : object of type :class:`~sklearn.impute.SimpleImputer` Imputer used to initialize the missing values. imputation_sequence_ : list of tuples Each tuple has `(feat_idx, neighbor_feat_idx, estimator)`, where `feat_idx` is the current feature to be imputed, `neighbor_feat_idx` is the array of other features used to impute the current feature, and `estimator` is the trained estimator used for the imputation. Length is `self.n_features_with_missing_ * self.n_iter_`. n_iter_ : int Number of iteration rounds that occurred. Will be less than `self.max_iter` if early stopping criterion was reached. n_features_in_ : int Number of features seen during :term:`fit`. .. versionadded:: 0.24 feature_names_in_ : ndarray of shape (`n_features_in_`,) Names of features seen during :term:`fit`. Defined only when `X` has feature names that are all strings. .. versionadded:: 1.0 n_features_with_missing_ : int Number of features with missing values. indicator_ : :class:`~sklearn.impute.MissingIndicator` Indicator used to add binary indicators for missing values. `None` if `add_indicator=False`. random_state_ : RandomState instance RandomState instance that is generated either from a seed, the random number generator or by `np.random`. See Also -------- SimpleImputer : Univariate imputer for completing missing values with simple strategies. KNNImputer : Multivariate imputer that estimates missing features using nearest samples. Notes ----- To support imputation in inductive mode we store each feature's estimator during the :meth:`fit` phase, and predict without refitting (in order) during the :meth:`transform` phase. Features which contain all missing values at :meth:`fit` are discarded upon :meth:`transform`. Using defaults, the imputer scales in :math:`\mathcal{O}(knp^3\min(n,p))` where :math:`k` = `max_iter`, :math:`n` the number of samples and :math:`p` the number of features. It thus becomes prohibitively costly when the number of features increases. Setting `n_nearest_features << n_features`, `skip_complete=True` or increasing `tol` can help to reduce its computational cost. Depending on the nature of missing values, simple imputers can be preferable in a prediction context. References ---------- .. [1] `Stef van Buuren, Karin Groothuis-Oudshoorn (2011). "mice: Multivariate Imputation by Chained Equations in R". Journal of Statistical Software 45: 1-67. `_ .. [2] `S. F. Buck, (1960). "A Method of Estimation of Missing Values in Multivariate Data Suitable for use with an Electronic Computer". Journal of the Royal Statistical Society 22(2): 302-306. `_ Examples -------- >>> import numpy as np >>> from sklearn.experimental import enable_iterative_imputer >>> from sklearn.impute import IterativeImputer >>> imp_mean = IterativeImputer(random_state=0) >>> imp_mean.fit([[7, 2, 3], [4, np.nan, 6], [10, 5, 9]]) IterativeImputer(random_state=0) >>> X = [[np.nan, 2, 3], [4, np.nan, 6], [10, np.nan, 9]] >>> imp_mean.transform(X) array([[ 6.9584, 2. , 3. ], [ 4. , 2.6000, 6. ], [10. , 4.9999, 9. ]]) For a more detailed example see :ref:`sphx_glr_auto_examples_impute_plot_missing_values.py` or :ref:`sphx_glr_auto_examples_impute_plot_iterative_imputer_variants_comparison.py`. Nfitpredictbooleanrleft)closedr>meanmedianconstant most_frequent no_validation>romanarabicrandom ascending descendingbothz array-likeverbose random_state) r&sample_posteriormax_itertoln_nearest_featuresinitial_strategy fill_valueimputation_order skip_complete min_value max_valuerDrE_parameter_constraintsF gMbP?r9rA)missing_valuesrFrGrHrIrJrKrLrMrNrOrDrE add_indicatorkeep_empty_featuresct||||||_||_||_||_||_||_||_| |_ | |_ | |_ | |_ | |_ ||_y)N)rRrSrT)super__init__r&rFrGrHrIrJrKrLrMrNrOrDrE)selfr&rRrFrGrHrIrJrKrLrMrNrOrDrErSrT __class__s r/rWzIterativeImputer.__init__:s( )' 3  # 0  "4 0$ 0*"" (r1cJ||dur td|t|j}|dd|f}|rJtt||d|d} tt||d|d} |j| | fi|t j |dk(r||fStt||d|d} |jr|j| d\} } t j| j|j }| dkD}| |||<| |j|k}|j|||<| |j|kD}|j|||<||z|z}| |} | |} |j|| z | z }|j|| z | z }tj||| | }|j!|j" ||<nB|j| }t j$||j||j|}t'|||| ||fS) aImpute a single feature from the others provided. This function predicts the missing values of one of the features using the current estimates of all the other features. The `estimator` must support `return_std=True` in its `predict` method for this function to work. Parameters ---------- X_filled : ndarray Input data with the most recent imputations. mask_missing_values : ndarray Input data's missing indicator matrix. feat_idx : int Index of the feature currently being imputed. neighbor_feat_idx : ndarray Indices of the features to be used in imputing `feat_idx`. estimator : object The estimator to use at this step of the round-robin imputation. If `sample_posterior=True`, the estimator must support `return_std` in its `predict` method. If None, it will be cloned from self._estimator. fit_mode : boolean, default=True Whether to fit and predict with the estimator or just predict. params : dict Additional params routed to the individual estimator. Returns ------- X_filled : ndarray Input data with `X_filled[missing_row_mask, feat_idx]` updated. estimator : estimator with sklearn API The fitted estimator used to impute `X_filled[missing_row_mask, feat_idx]`. NFzKIf fit_mode is False, then an already-fitted estimator should be passed in.raxisrT) return_std)dtype)ablocscale)rE) row_indexercolumn_indexer) ValueErrorr _estimatorr r4npsumrFr5zerosshaper^ _min_value _max_valuer truncnormrvs random_state_clipr)rXX_filledmask_missing_valuesr$r%r&fit_modeparamsmissing_row_maskX_trainy_trainX_testmussigmasimputed_valuespositive_sigmas mus_too_low mus_too_high inrange_maskr_r`truncated_normals r/_impute_one_featurez$IterativeImputer._impute_one_featurebsvh  U!21   doo.I.q({; $x):C!!G %x:!!G IMM'7 5f 5 66" #q (Y& & 8%6Q ?    #++Ft+DKCXXciix~~FN%qjO/2O3C/DNO+ , 99K*.//(*CN; '!::L+/??8+DN< (*k\9\MILl#CL)F*S0F:A*S0F:A$aSO +;+?+?!//,@,N< ('..v6NWW 94??8;TN   (#  ""r1cT|jV|j|krG|dd|f}|jjtj||jd|}|Stj|}tj|dz|}tj ||f}|S)azGet a list of other features to predict `feat_idx`. If `self.n_nearest_features` is less than or equal to the total number of features, then use a probability proportional to the absolute correlation between `feat_idx` and each other feature to randomly choose a subsample of the other features (without replacement). Parameters ---------- n_features : int Number of features in `X`. feat_idx : int Index of the feature currently being imputed. abs_corr_mat : ndarray, shape (n_features, n_features) Absolute correlation matrix of `X`. The diagonal has been zeroed out and each feature has been normalized to sum to 1. Can be None. Returns ------- neighbor_feat_idx : array-like The features to use to impute `feat_idx`. NF)replacepr)rIrochoicergarange concatenate)rX n_featuresr$ abs_corr_matrr% inds_left inds_rights r/_get_neighbor_feat_idxz'IterativeImputer._get_neighbor_feat_idxs2  " " .43J3JZ3WQ[)A $ 2 2 9 9 *%t'>'>QR!:! !  (+I8a<r?NrA mergesort)kindrBr@) r9rMrg flatnonzerorrjrLlenargsortroshuffle)rXrrfrac_of_missing_valuesmissing_values_idx ordered_idxns r/_get_ordered_idxz!IterativeImputer._get_ordered_idxsW("5!9!9q!9!A   !#0F!G !#2884J+KA+N!O   G +,K " "h .,TrT2K " "k 1*+c2D.EEA**%;+NqrRK  " "l 2*+c2D.EEA**%;+NqrRSWUWSWXK " "h .,K    & &{ 3r1c|jd}|j|j|k\rytjd5tjtj |j }ddd|tj|<tj||d|tj|dt|ddd }|S#1swYaxYw) aGet absolute correlation matrix between features. Parameters ---------- X_filled : ndarray, shape (n_samples, n_features) Input data with the most recent imputations. tolerance : float, default=1e-6 `abs_corr_mat` can have nans, which will be replaced with `tolerance`. Returns ------- abs_corr_mat : ndarray, shape (n_features, n_features) Absolute correlation matrix of `X` at the beginning of the current round. The diagonal has been zeroed out and each feature's absolute correlations with all others have been normalized to sum to 1. rNignore)invalid)outrl1F)normr\copy) rjrIrgerrstateabscorrcoefTisnanrp fill_diagonalr )rXrq tolerancerrs r/_get_abs_corr_matz"IterativeImputer._get_abs_corr_mat)s(^^A&  " " *d.E.E.S [[ * ;66"++hjj"9:L  ; 09 RXXl+,  i<@ q) DquM  ; ;s 3CCcBt|jrd}nd}t||td||}t ||jt ||j}|j }|jdk(xr |j }|jt|j|j|j|jjd |_ |rStj5tjd t |jj#|}dddn|jj#|}np|rStj5tjd t |jj%|}dddn|jj%|}|rt'j(|d |_|js]|dd|j*f}|dd|j*f}|jj-d dk(rNdd|j*f}n9d|dd|j*f<|}dd|j*f|dd|j*f<|||fS#1swYxYw#1swYxYw)aPerform initial imputation for input `X`. Parameters ---------- X : ndarray of shape (n_samples, n_features) Input data, where `n_samples` is the number of samples and `n_features` is the number of features. in_fit : bool, default=False Whether function is called in :meth:`fit`. Returns ------- Xt : ndarray of shape (n_samples, n_features) Input data, where `n_samples` is the number of samples and `n_features` is the number of features. X_filled : ndarray of shape (n_samples, n_features) Input data with the most recent imputations. mask_missing_values : ndarray of shape (n_samples, n_features) Input data's missing indicator matrix, where `n_samples` is the number of samples and `n_features` is the number of features, masked by non-missing features. X_missing_mask : ndarray, shape (n_samples, n_features) Input data's mask matrix indicating missing datapoints, where `n_samples` is the number of samples and `n_features` is the number of features. z allow-nanTF)r^orderresetensure_all_finiter;N)rRstrategyrKrTdefault) transformrrr[rF)rrRrrr"rrrJrTinitial_imputer_r rK set_outputwarningscatch_warnings simplefilter FutureWarning fit_transformrrgall_is_empty_feature get_params) rXXin_fitrX_missing_maskrr catch_warningrqXts r/_initial_imputationz$IterativeImputer._initial_imputationOs> ,, - +  $    /   At223"1d&9&9:,113  ! !Z / P8P8P4P   ($1#22..??$($<$< % j9j-  !,,.F))(MB#44BB1EHFF 00>>qA,,.B))(MB#44>>qAHBB 00::1= %'VV,?a%HD "''1t----.B"5a$:P:P9P6P"Q $$//1*=K$A(>(>'>$>? >C 4#9#9 9 :B,4Q8N8N5N,OBq$((( )80.@@OFFBBs86J )6J JJc t|}|Atj|s,t||k7rtd|d|dt |d|dk(rtj ntj }||n|}tj|rtj ||}t|ddd}|st |t |k(r||}|S)aValidate the limits (min/max) of the feature values. Converts scalar min/max limits to vectors of shape `(n_features,)`. Parameters ---------- limit: scalar or array-like The user-specified limit (i.e, min_value or max_value). limit_type: {'max', 'min'} Type of limit to validate. n_features: int Number of features in the dataset. is_empty_feature: ndarray, shape (n_features, ) Mask array indicating empty feature imputer has seen during fit. keep_empty_feature: bool If False, remove empty-feature indices from the limit. Returns ------- limit: ndarray, shape(n_features,) Array of limits, one for each feature. 'z_value' should be of shape (z',) when an array-like is provided. Got z , instead.maxF)rr ensure_2d)rrgisscalarrerinffullr)limit limit_typeris_empty_featurekeep_empty_feature n_features_in limit_bounds r/_validate_limitz IterativeImputer._validate_limits4%%56  KK&U#}4J<;M?K003E |:G  !+e 3bff"&& $} % ;;u GGJ.EEURWX"c%jC8H4I&I++,E r1)prefer_skip_nested_validationc t||dt|dfi|}t|dt|j|_|j ddlm}||_ nt|j |_ g|_ d|_ |j|d\}}}}t|=|t|A|} |j"dk(st%j&|rd|_t|U|| S|j,d d k(rd|_t|U|| S|j/|j0d |j,d |j2|j4|_|j/|j8d |j,d |j2|j4|_t%j&t%j<|j:|j6s t?d |jA|} tC| |_"|jG|} |j,\} } |jHdkDrtKd |j,tM}|jNsI|jQ}|jRt%jTt%jV||z}tYd |j"d zD]s|_|jZdk(r|jA|} | D]l}|j]| || }|j_||||dd|j j`\}}tc|||}|jje|n|jHd kDr0tKd|j(|j"tM|z fz|jNrt$jfji|z t$jjd}|jHdkDrtKdjm||kr|jHdkDr tKdn9|jQ}v|jNstojpdtrtu|||t|U|| S)agFit the imputer on `X` and return the transformed `X`. Parameters ---------- X : array-like, shape (n_samples, n_features) Input data, where `n_samples` is the number of samples and `n_features` is the number of features. y : Ignored Not used, present for API consistency by convention. **params : dict Parameters routed to the `fit` method of the sub-estimator via the metadata routing API. .. versionadded:: 1.5 Only available if `sklearn.set_config(enable_metadata_routing=True)` is set. See :ref:`Metadata Routing User Guide ` for more details. Returns ------- Xt : array-like, shape (n_samples, n_features) The imputed input data. r4roNr) BayesianRidgeTrrrminrz3One (or more) features have min_value >= max_value.0[IterativeImputer] Completing matrix with shape r@)r&rsrtD[IterativeImputer] Ending imputation round %d/%d, elapsed time %0.2f)ordr\z4[IterativeImputer] Change: {}, scaled tolerance: {} z4[IterativeImputer] Early stopping criterion reached.z8[IterativeImputer] Early stopping criterion not reached.r));rrgetattrrrEror& linear_modelrrfr imputation_sequence_rrrV_fit_indicator_transform_indicatorrGrgrn_iter__concatenate_indicatorrjrrNrrTrkrOrlgreaterrerrn_features_with_missing_rrDprintrrFrrHrrrangerLrrr4r#appendlinalgrrformatrwarnr r0)rXryrt routed_paramsrrrr complete_mask X_indicatorrr n_samplesrstart_t Xt_previousnormalized_tolr$r%r&estimator_tripletinf_normrYs r/rzIterativeImputer.fit_transforms0> &$.'    % /#5d6G6G#H  >> ! 4+oDO#DNN3DO$&! $484L4L d5M5 12"M }-g2=A ==A (;!<DL71"kB B 88A;! DL71"kB B.. NN  GGAJ  " "  $ $  .. NN  GGAJ  " "  $ $  vvbjj$//BCRS S ++,?@ (+K(8%--b1 " : <>"{*:T>R<>r1c t||j|d\}}}}t | |}|jdk(st j |rt |||St|j|jz}d}|jdkDrtd|jt}t|jD]\} } |j||| j | j"| j$d\}} | dz|zrG|jdkDr)td|dz|jt|z fz|dz }t'|||t |||S) aImpute all missing values in `X`. Note that this is stochastic, and that if `random_state` is not fixed, repeated calls, or permuted input, results will differ. Parameters ---------- X : array-like of shape (n_samples, n_features) The input data to complete. Returns ------- Xt : array-like, shape (n_samples, n_features) The imputed input data. Frrr)r&rsrrr)rrrVrrrgrrrrrDrrjr enumeraterr$r%r&r0) rXrrrrrrimputations_per_roundi_rndritr_rYs r/rzIterativeImputer.transforms 484L4L e5M5 12"Mg2=A <<1 ': ;71"kB B #D$=$= >$,, N <>r1c ,|j|fi||S)a5Fit the imputer on `X` and return self. Parameters ---------- X : array-like, shape (n_samples, n_features) Input data, where `n_samples` is the number of samples and `n_features` is the number of features. y : Ignored Not used, present for API consistency by convention. **fit_params : dict Parameters routed to the `fit` method of the sub-estimator via the metadata routing API. .. versionadded:: 1.5 Only available if `sklearn.set_config(enable_metadata_routing=True)` is set. See :ref:`Metadata Routing User Guide ` for more details. Returns ------- self : object Fitted estimator. )r)rXrr fit_paramss r/r4zIterativeImputer.fits6 1+ + r1ct|dt||}|jj|}|j ||S)aGet output feature names for transformation. Parameters ---------- input_features : array-like of str or None, default=None Input features. - If `input_features` is `None`, then `feature_names_in_` is used as feature names in. If `feature_names_in_` is not defined, then the following input feature names are generated: `["x0", "x1", ..., "x(n_features_in_ - 1)"]`. - If `input_features` is an array-like, then `input_features` must match `feature_names_in_` if `feature_names_in_` is defined. Returns ------- feature_names_out : ndarray of str objects Transformed feature names. n_features_in_)rrrget_feature_names_out(_concatenate_indicator_feature_names_out)rXinput_featuresnamess r/rz&IterativeImputer.get_feature_names_outsD( ./0~F%%;;NK<` on how the routing mechanism works. .. versionadded:: 1.5 Returns ------- routing : MetadataRouter A :class:`~sklearn.utils.metadata_routing.MetadataRouter` encapsulating routing information. )ownerr4)calleecaller)r&method_mapping)rrY__name__addr&r)rXrouters r/get_metadata_routingz%IterativeImputer.get_metadata_routingsL dnn&=&=>BBnn(?..eE.JC  r1)N)NTN)gư>)F)r __module__ __qualname____doc__r!rPrrrrrdict__annotations__rgnanrrWrrrrr staticmethodrr rrr4rr __classcell__)rYs@r/r3r3<sfP$  - -$Jy'9:;&Kh4?@q$v67#Xh4%OP F G & O P $HT4fE|THT4fE|T;'(%$D.&)vv $66'&&!%&)\y#v"!H&P$LiAV..`&+V? V?p4?l<T2r1r3)2r collectionsrnumbersrrrnumpyrgscipyrbaser r exceptionsr preprocessingr utilsr rrutils._indexingr utils._maskrutils._missingrutils._param_validationrrrutils.metadata_routingrrrrutils.validationrrrrr_baser r!r"r#r0r3r1r/r sw""&+%CC*#*FF DCE (J|Jr1