Module Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias ImportFrom alias alias Import alias Import alias Assign NameStore ListLoad Str Str Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Assign NameStore CompareGtE NameLoad Num If CompareNotIn NameLoad ListLoad Num Num body Assign NameStore BinOpMult Num Call AttributeLoad NameLoad attr BinOpDiv BinOpAdd Num NameLoad BinOpSub Num NameLoad Assign NameStore BinOpDiv Num Call AttributeLoad NameLoad attr BinOpSub Call NameLoad NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr BinOpSub NameLoad BinOpMult Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad BinOpMult Num NameLoad If CompareNotEq Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad keyword AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Assign NameStore SubscriptLoad NameLoad Slice Num Assign NameStore SubscriptLoad NameLoad Slice Num If BoolOpOr CompareIsNot NameLoad NameLoad CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpMult Call AttributeLoad NameLoad attr NameLoad BinOpMult NameLoad NameLoad Num If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index Num NameLoad Assign SubscriptStore NameLoad Index Num NameLoad If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index Num NameLoad Assign SubscriptStore NameLoad Index Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad If NameLoad body Return NameLoad orelse Return SubscriptLoad NameLoad Slice Num decorator_list ClassDef bases NameLoad NameLoad NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad Str body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad Call NameLoad Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Delete AttributeDel NameLoad attr decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad Call NameLoad Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Delete AttributeDel NameLoad attr decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body If CompareNotEq Call NameLoad AttributeLoad NameLoad attr Num body Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareNotIn AttributeLoad NameLoad attr ListLoad Str Str Str body Raise Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign NameStore CompareEq AttributeLoad NameLoad attr Str If CompareEq Call NameLoad NameLoad Num body Assign AttributeStore NameLoad attr Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword Str keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Expr Call NameLoad NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore ListComp Call NameLoad NameLoad keyword NameLoad comprehension NameStore ListLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad If CompareEq AttributeLoad NameLoad attr Str body Assign AttributeStore NameLoad attr Call NameLoad NameLoad NameLoad orelse Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad keyword NameLoad Assign NameStore CompareGt NameLoad Num Assign TupleStore NameStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore ListComp Call NameLoad SubscriptLoad NameLoad Index NameLoad AttributeLoad NameLoad attr keyword NameLoad comprehension NameStore ListLoad NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameStore NameLoad Assign AttributeStore NameLoad attr NameStore Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr TupleLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Call NameLoad NameLoad keyword NameLoad Assign SubscriptStore NameLoad Slice Num Num Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num Num SubscriptLoad NameLoad Slice Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num Num SubscriptLoad NameLoad Slice Num Return TupleLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad orelse Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr TupleLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad If CompareNotEq Call NameLoad AttributeLoad NameLoad attr Num body Raise Call NameLoad Str If CompareNotIn AttributeLoad NameLoad attr ListLoad Str Str Str body Raise Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If BoolOpAnd Call NameLoad NameLoad Str Call NameLoad NameLoad Str body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A numpy np scipy interpolate scipy.stats spearmanr base BaseEstimator TransformerMixin RegressorMixin utils as_float_array check_array check_consistent_length utils deprecated utils.fixes astype _isotonic _isotonic_regression _make_unique N/A warnings N/A math N/A __all__ N/A check_increasing isotonic_regression IsotonicRegression check_increasing N/A N/A x y N/A N/A N/A Determine whether y is monotonically correlated with x.

    y is found increasing or decreasing with respect to x based on a Spearman
    correlation test.

    Parameters
    ----------
    x : array-like, shape=(n_samples,)
            Training data.

    y : array-like, shape=(n_samples,)
        Training target.

    Returns
    -------
    `increasing_bool` : boolean
        Whether the relationship is increasing or decreasing.

    Notes
    -----
    The Spearman correlation coefficient is estimated from the data, and the
    sign of the resulting estimate is used as the result.

    In the event that the 95% confidence interval based on Fisher transform
    spans zero, a warning is raised.

    References
    ----------
    Fisher transformation. Wikipedia.
    https://en.wikipedia.org/wiki/Fisher_transformation
     N/A N/A rho _ N/A spearmanr x y N/A increasing_bool N/A rho 0 N/A N/A rho N/A -1.0 1.0 N/A N/A F N/A 0.5 N/A N/A math log N/A N/A 1.0 rho N/A 1.0 rho N/A F_se N/A 1 N/A N/A math sqrt N/A N/A len x 3 N/A rho_0 N/A N/A math tanh N/A F N/A 1.96 F_se N/A rho_1 N/A N/A math tanh N/A F N/A 1.96 F_se N/A N/A N/A N/A np sign rho_0 N/A N/A np sign rho_1 N/A N/A N/A N/A warnings warn Confidence interval of the Spearman correlation coefficient spans zero. Determination of ``increasing`` may be suspect. N/A increasing_bool N/A isotonic_regression N/A N/A y sample_weight y_min y_max increasing N/A None None None True N/A N/A Solve the isotonic regression model::

        min sum w[i] (y[i] - y_[i]) ** 2

        subject to y_min = y_[1] <= y_[2] ... <= y_[n] = y_max

    where:
        - y[i] are inputs (real numbers)
        - y_[i] are fitted
        - w[i] are optional strictly positive weights (default to 1.0)

    Read more in the :ref:`User Guide <isotonic>`.

    Parameters
    ----------
    y : iterable of floating-point values
        The data.

    sample_weight : iterable of floating-point values, optional, default: None
        Weights on each point of the regression.
        If None, weight is set to 1 (equal weights).

    y_min : optional, default: None
        If not None, set the lowest value of the fit to y_min.

    y_max : optional, default: None
        If not None, set the highest value of the fit to y_max.

    increasing : boolean, optional, default: True
        Whether to compute ``y_`` is increasing (if set to True) or decreasing
        (if set to False)

    Returns
    -------
    y_ : list of floating-point values
        Isotonic fit of y.

    References
    ----------
    "Active set algorithms for isotonic regression; A unifying framework"
    by Michael J. Best and Nilotpal Chakravarti, section 3.
     N/A y N/A N/A np asarray y dtype N/A np float64 N/A N/A sample_weight None N/A N/A sample_weight N/A N/A np ones N/A len y dtype N/A y dtype N/A N/A sample_weight N/A N/A np asarray sample_weight dtype N/A np float64 N/A N/A increasing N/A N/A y N/A y N/A -1 N/A sample_weight N/A sample_weight N/A -1 N/A N/A N/A y_min None N/A y_max None N/A N/A y N/A N/A np copy y N/A sample_weight N/A N/A np copy sample_weight N/A C N/A N/A N/A np dot sample_weight N/A y y 10 N/A N/A y_min None N/A N/A N/A y N/A 0 y_min N/A N/A sample_weight N/A 0 C N/A N/A y_max None N/A N/A N/A y N/A -1 y_max N/A N/A sample_weight N/A -1 C N/A solution N/A N/A np empty N/A len y N/A y_ N/A _isotonic_regression y sample_weight solution N/A increasing N/A N/A y_ N/A N/A N/A y_ N/A -1 N/A IsotonicRegression N/A BaseEstimator TransformerMixin RegressorMixin N/A N/A Isotonic regression model.

    The isotonic regression optimization problem is defined by::

        min sum w_i (y[i] - y_[i]) ** 2

        subject to y_[i] <= y_[j] whenever X[i] <= X[j]
        and min(y_) = y_min, max(y_) = y_max

    where:
        - ``y[i]`` are inputs (real numbers)
        - ``y_[i]`` are fitted
        - ``X`` specifies the order.
          If ``X`` is non-decreasing then ``y_`` is non-decreasing.
        - ``w[i]`` are optional strictly positive weights (default to 1.0)

    Read more in the :ref:`User Guide <isotonic>`.

    Parameters
    ----------
    y_min : optional, default: None
        If not None, set the lowest value of the fit to y_min.

    y_max : optional, default: None
        If not None, set the highest value of the fit to y_max.

    increasing : boolean or string, optional, default: True
        If boolean, whether or not to fit the isotonic regression with y
        increasing or decreasing.

        The string value "auto" determines whether y should
        increase or decrease based on the Spearman correlation estimate's
        sign.

    out_of_bounds : string, optional, default: "nan"
        The ``out_of_bounds`` parameter handles how x-values outside of the
        training domain are handled.  When set to "nan", predicted y-values
        will be NaN.  When set to "clip", predicted y-values will be
        set to the value corresponding to the nearest train interval endpoint.
        When set to "raise", allow ``interp1d`` to throw ValueError.


    Attributes
    ----------
    X_min_ : float
        Minimum value of input array `X_` for left bound.

    X_max_ : float
        Maximum value of input array `X_` for right bound.

    f_ : function
        The stepwise interpolating function that covers the domain `X_`.

    Notes
    -----
    Ties are broken using the secondary method from Leeuw, 1977.

    References
    ----------
    Isotonic Median Regression: A Linear Programming Approach
    Nilotpal Chakravarti
    Mathematics of Operations Research
    Vol. 14, No. 2 (May, 1989), pp. 303-308

    Isotone Optimization in R : Pool-Adjacent-Violators
    Algorithm (PAVA) and Active Set Methods
    Leeuw, Hornik, Mair
    Journal of Statistical Software 2009

    Correctness of Kruskal's algorithms for monotone regression with ties
    Leeuw, Psychometrica, 1977
     __init__ N/A N/A self y_min y_max increasing out_of_bounds N/A None None True nan N/A N/A N/A self y_min y_min N/A N/A self y_max y_max N/A N/A self increasing increasing N/A N/A self out_of_bounds out_of_bounds N/A X_ N/A N/A self N/A N/A N/A N/A self _X_ N/A property N/A deprecated Attribute ``X_`` is deprecated in version 0.18 and will be removed in version 0.20. X_ N/A N/A self value N/A N/A N/A N/A self _X_ value N/A N/A X_ setter X_ N/A N/A self N/A N/A N/A N/A self _X_ N/A N/A X_ deleter y_ N/A N/A self N/A N/A N/A N/A self _y_ N/A property N/A deprecated Attribute ``y_`` is deprecated in version 0.18 and will be removed in version 0.20. y_ N/A N/A self value N/A N/A N/A N/A self _y_ value N/A N/A y_ setter y_ N/A N/A self N/A N/A N/A N/A self _y_ N/A N/A y_ deleter _check_fit_data N/A N/A self X y sample_weight N/A None N/A N/A N/A N/A len N/A X shape 1 N/A N/A N/A ValueError X should be a 1d array N/A _build_f N/A N/A self X y N/A N/A N/A Build the f_ interp1d function. N/A N/A N/A self out_of_bounds N/A raise nan clip N/A N/A N/A ValueError N/A N/A The argument ``out_of_bounds`` must be in 'nan', 'clip', 'raise'; got {0} format N/A self out_of_bounds N/A bounds_error N/A N/A self out_of_bounds raise N/A N/A N/A len y 1 N/A N/A N/A self f_ N/A N/A N/A x N/A N/A N/A y repeat N/A x shape N/A N/A N/A self f_ N/A N/A interpolate interp1d X y kind linear bounds_error bounds_error N/A _build_y N/A N/A self X y sample_weight trim_duplicates N/A True N/A N/A Build the y_ IsotonicRegression. N/A N/A check_consistent_length X y sample_weight N/A N/A X y N/A N/A check_array x ensure_2d False N/A x N/A X y N/A y N/A as_float_array y N/A N/A N/A self _check_fit_data X y sample_weight N/A N/A N/A self increasing auto N/A N/A N/A self increasing_ N/A check_increasing X y N/A N/A N/A self increasing_ N/A self increasing N/A N/A sample_weight None N/A N/A sample_weight N/A check_array sample_weight ensure_2d False N/A mask N/A sample_weight 0 N/A N/A X y sample_weight N/A N/A X N/A mask N/A y N/A mask N/A sample_weight N/A mask N/A N/A sample_weight N/A N/A np ones N/A len y N/A order N/A N/A np lexsort N/A y X N/A N/A X y sample_weight N/A N/A astype N/A array N/A order N/A np float64 copy False N/A array N/A X y sample_weight N/A N/A unique_X unique_y unique_sample_weight N/A _make_unique X y sample_weight N/A N/A self _X_ X unique_X N/A N/A self _y_ y N/A isotonic_regression unique_y unique_sample_weight N/A self y_min N/A self y_max increasing N/A self increasing_ N/A N/A N/A self X_min_ N/A self X_max_ N/A N/A N/A np min X N/A N/A np max X N/A trim_duplicates N/A N/A keep_data N/A N/A np ones N/A N/A len y dtype bool N/A N/A keep_data N/A 1 -1 N/A N/A np logical_or N/A N/A np not_equal N/A y N/A 1 -1 N/A y N/A -2 N/A N/A np not_equal N/A y N/A 1 -1 N/A y N/A 2 N/A N/A N/A X N/A keep_data N/A y N/A keep_data N/A N/A N/A X y N/A fit N/A N/A self X y sample_weight N/A None N/A N/A Fit the model using X, y as training data.

        Parameters
        ----------
        X : array-like, shape=(n_samples,)
            Training data.

        y : array-like, shape=(n_samples,)
            Training target.

        sample_weight : array-like, shape=(n_samples,), optional, default: None
            Weights. If set to None, all weights will be set to 1 (equal
            weights).

        Returns
        -------
        self : object
            Returns an instance of self.

        Notes
        -----
        X is stored for future use, as `transform` needs X to interpolate
        new input data.
         N/A N/A X y N/A N/A self _build_y X y sample_weight N/A N/A N/A self _necessary_X_ N/A self _necessary_y_ N/A X y N/A N/A N/A self _build_f X y N/A self N/A transform N/A N/A self T N/A N/A N/A Transform new data by linear interpolation

        Parameters
        ----------
        T : array-like, shape=(n_samples,)
            Data to transform.

        Returns
        -------
        T_ : array, shape=(n_samples,)
            The transformed data
         N/A T N/A as_float_array T N/A N/A N/A len N/A T shape 1 N/A N/A N/A ValueError Isotonic regression input should be a 1d array N/A N/A N/A self out_of_bounds N/A raise nan clip N/A N/A N/A ValueError N/A N/A The argument ``out_of_bounds`` must be in 'nan', 'clip', 'raise'; got {0} format N/A self out_of_bounds N/A N/A N/A self out_of_bounds clip N/A N/A T N/A N/A np clip T N/A self X_min_ N/A self X_max_ N/A N/A N/A self f_ T N/A predict N/A N/A self T N/A N/A N/A Predict new data by linear interpolation.

        Parameters
        ----------
        T : array-like, shape=(n_samples,)
            Data to transform.

        Returns
        -------
        T_ : array, shape=(n_samples,)
            Transformed data.
         N/A N/A N/A self transform T N/A __getstate__ N/A N/A self N/A N/A N/A Pickle-protocol - return state of the estimator.  N/A state N/A dict N/A self __dict__ N/A N/A N/A state pop f_ None N/A state N/A __setstate__ N/A N/A self state N/A N/A N/A Pickle-protocol - set state of the estimator.

        We need to rebuild the interpolation function.
         N/A N/A N/A N/A self __dict__ update state N/A N/A N/A hasattr self _necessary_X_ N/A hasattr self _necessary_y_ N/A N/A N/A N/A self _build_f N/A self _necessary_X_ N/A self _necessary_y_ N/A N/A