
    \!h                         S SK rSS jrg)    Nc                    US::  d  US:  a  [        S5      eU" U 5      n[        U[        5      (       d9  [        U[        5      (       d$  [	        UR
                  5      S:w  a  [        S5      e[        R                  R                  U5      n[        R                  " US9nS n	[        R                  " U R
                  S   5      n
[        U5       H,  nUR                  XR
                  S   SS9nU" X   5      X'   M.     Un[        R                  " XS	9n[        R                  " U5      nSU-
  S
-  nU	" XU-   S9nU	" UUS9nXUU44$ )a  Implements the ordinary nonparametric bootstrap

Parameters
----------

x : NumPy array, shape=(n_samples, [n_columns])
    An one or multidimensional array of data records

func : <func>
    A function which computes a statistic that is used
    to compute the bootstrap replicates (the statistic computed
    from the bootstrap samples). This function must return a
    scalar value. For example, `np.mean` or `np.median` would be
    an acceptable argument for `func` if `x` is a 1-dimensional array
    or vector.

num_rounds : int (default=1000)
    The number of bootstrap samples to draw where each
    bootstrap sample has the same number of records as the
    original dataset.

ci : int (default=0.95)
    An integer in the range (0, 1) that represents the
    confidence level for computing the confidence interval.
    For example, `ci=0.95` (default)
    will compute the 95% confidence
    interval from the bootstrap replicates.

ddof : int
    The delta degrees of freedom used when computing the
    standard error.

seed : int or None (default=None)
    Random seed for generating bootstrap samples.

Returns
-------

original, standard_error, (lower_ci, upper_ci) : tuple
    Returns the statistic of the original sample (`original`),
    the standard error of the estimate, and the
    respective confidence interval bounds.

Examples
--------

>>> from mlxtend.evaluate import bootstrap
>>> rng = np.random.RandomState(123)
>>> x = rng.normal(loc=5., size=100)
>>> original, std_err, ci_bounds = bootstrap(x,
...                                          num_rounds=1000,
...                                          func=np.mean,
...                                          ci=0.95,
...                                          seed=123)
>>> print('Mean: %.2f, SE: +/- %.2f, CI95: [%.2f, %.2f]' % (original,
...                                                         std_err,
...                                                         ci_bounds[0],
...                                                         ci_bounds[1]))
Mean: 5.03, SE: +/- 0.11, CI95: [4.80, 5.26]
>>>

For more usage examples, please see
https://rasbt.github.io/mlxtend/user_guide/evaluate/bootstrap/

r      zci must be in range (0, 1)zfunc must return a scalar)shapec                     [        XR                  S   -  5      S-
  nX R                  S   :  a  U R                  S   nOUS::  a  Sn[        [        U5      5      nX   $ )Nr   r   )roundr   int)xqranks      mC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\mlxtend/evaluate/bootstrap.pyquantilebootstrap.<locals>.quantile`   sW    Q^$q(771:771:DQYD5;w    T)sizereplace)ddofg       @)r
   )AttributeError
isinstancefloatr   lenr   nprandomRandomStatezerosarangerangechoicestdsort)r	   func
num_roundscir   seedcheck_outputrngbootstrap_replicatesr   
sample_idxibootstrap_idxoriginalstandard_errortboundupper_cilower_cis                      r   	bootstrapr0      s<   D 
Qw"'9::7L |U++<--""#q(899
))


%C88*5
 1771:&J:

:4D4DQ4GQU
V"&q'7"8 
 HVV0<N
$%AVsNE5j*HU#Hh%999r   )i  gffffff?r   N)numpyr   r0    r   r   <module>r3      s    l:r   