CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
_fixes.cpython-310.pyc116 linesDownload Raw Back to __pycache__
1o

2'�Yi��@sTzddlmZWney#ddlmZmZ					ddd�ZYnwdd	�Zd3S)�)�
validate_data)�check_array�	check_X_y�
no_validationTFc
Ks@t|t�o|dk}|dupt|t�o|dk}|r|rtd��d|i}	i|	�|�}|r@|s2|r2|}4|5S|r:|s:|}6|7S||f}8|9S|sP|rPt|fddi|��}10|11S|r`|s`t|fddi|��}12|13S|r�|\}}d|vrpi|	�|�}t|fddi|��}d|vr�i|	�|�}t|fddi|��}nt||fi|��\}}||f}14|15S)aa
Validate input data and set or check feature names and counts of the input.16 17        This helper function should be used in an estimator that requires input18        validation. This mutates the estimator and sets the `n_features_in_` and19        `feature_names_in_` attributes if `reset=True`.20 21        .. versionadded:: 1.622 23        Parameters24        ----------25        _estimator : estimator instance26            The estimator to validate the input for.27 28        X : {array-like, sparse matrix, dataframe} of shape                 (n_samples, n_features), default='no validation'29            The input samples.30            If `'no_validation'`, no validation is performed on `X`. This is31            useful for meta-estimator which can delegate input validation to32            their underlying estimator(s). In that case `y` must be passed and33            the only accepted `check_params` are `multi_output` and34            `y_numeric`.35 36        y : array-like of shape (n_samples,), default='no_validation'37            The targets.38 39            - If `None`, :func:`~sklearn.utils.check_array` is called on `X`. If40            the estimator's `requires_y` tag is True, then an error will be raised.41            - If `'no_validation'`, :func:`~sklearn.utils.check_array` is called42            on `X` and the estimator's `requires_y` tag is ignored. This is a default43            placeholder and is never meant to be explicitly set. In that case `X` must44            be passed.45            - Otherwise, only `y` with `_check_y` or both `X` and `y` are checked with46            either :func:`~sklearn.utils.check_array` or47            :func:`~sklearn.utils.check_X_y` depending on `validate_separately`.48 49        reset : bool, default=True50            Whether to reset the `n_features_in_` attribute.51            If False, the input will be checked for consistency with data52            provided when reset was last True.53 54            .. note::55 56            It is recommended to call `reset=True` in `fit` and in the first57            call to `partial_fit`. All other methods that validate `X`58            should set `reset=False`.59 60        validate_separately : False or tuple of dicts, default=False61            Only used if `y` is not `None`.62            If `False`, call :func:`~sklearn.utils.check_X_y`. Else, it must be a tuple63            of kwargs to be used for calling :func:`~sklearn.utils.check_array` on `X`64            and `y` respectively.65 66            `estimator=self` is automatically added to these dicts to generate67            more informative error message in case of invalid input data.68 69        skip_check_array : bool, default=False70            If `True`, `X` and `y` are unchanged and only `feature_names_in_` and71            `n_features_in_` are checked. Otherwise, :func:`~sklearn.utils.check_array`72            is called on `X` and `y`.73 74        **check_params : kwargs75            Parameters passed to :func:`~sklearn.utils.check_array` or76            :func:`~sklearn.utils.check_X_y`. Ignored if validate_separately77            is not False.78 79            `estimator=self` is automatically added to these params to generate80            more informative error message in case of invalid input data.81 82        Returns83        -------84        out : {ndarray, sparse matrix} or tuple of these85            The validated input. A tuple is returned if both `X` and `y` are86            validated.87        rNz*Validation should be done on X, y or both.�	estimatorZ88input_name�X�y)�89isinstance�str�90ValueErrorrr)
Z91_estimatorrr�resetZvalidate_separatelyZskip_check_arrayZcheck_paramsZno_val_XZno_val_yZdefault_check_params�outZcheck_X_paramsZcheck_y_params�r�}E:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\mne/decoding/_fixes.pyrs@T�����rcCsV|jd}|r||_dSt|d�sdS||jkr)td|�d|jj�d|j�d���dS)a9Set the `n_features_in_` attribute, or check against it on an estimator.92 93    Sklearn takes n_features from X.shape[1], but we need X.shape[-1]94 95    Parameters96    ----------97    estimator : estimator instance98        The estimator to validate the input for.99 100    X : {ndarray, sparse matrix} of shape ([n_epochs], n_samples, n_features)101        The input samples.102 103    reset : bool104        If True, the `n_features_in_` attribute is set to `X.shape[1]`.105        If False and the attribute exists, then check that it is equal to106        `X.shape[1]`. If False and the attribute does *not* exist, then107        the check is skipped.108        .. note::109        It is recommended to call reset=True in `fit` and in the first110        call to `partial_fit`. All other methods that validate `X`111        should set `reset=False`.112    �����N�n_features_in_zX has z features, but z is expecting z features as input.)�shaper�hasattrr�	__class__�__name__)rrrZ113n_featuresrrr�_check_n_features_3d�s114115116���rN)rrTFF)Zsklearn.utils.validationr�ImportErrorrrrrrrr�<module>s��
Aluode/PerceptionLabPortable · CoolFace