(output_array: np.ndarray,
                              value_increased: np.ndarray,
                              value_decreased: np.ndarray,
                              increase: bool = True)
return res.T
Reorganize the output matrix.

    This method reorganizes the output matrix in a way that allows the
    elementary effects to be computed as a simple subtraction between two
    arrays. It repositions the outputs in the output matrix according to the
    order they changed during the formation of the trajectories.

    Parameters
    ----------
    output_array: np.ndarray
        Matrix of model output values
    value_increased: np.ndarray
        Input variables that had their values increased when forming the
        trajectories matrix
    value_decreased: np.ndarray
        Input variables that had their values decreased when forming the
        trajectories matrix
    increase: bool
        Direction to consider (values that increased or decreased). "Increase"
        is the default value.
    Returns
    -------
Reorganize the output matrix.
Reorganize the output matrix .
def _reorganize_output_matrix(output_array: np.ndarray,
                              value_increased: np.ndarray,
                              value_decreased: np.ndarray,
                              increase: bool = True) -> np.ndarray:
    """Reorganize the output matrix.

    This method reorganizes the output matrix in a way that allows the
    elementary effects to be computed as a simple subtraction between two
    arrays. It repositions the outputs in the output matrix according to the
    order they changed during the formation of the trajectories.

    Parameters
    ----------
    output_array: np.ndarray
        Matrix of model output values
    value_increased: np.ndarray
        Input variables that had their values increased when forming the
        trajectories matrix
    value_decreased: np.ndarray
        Input variables that had their values decreased when forming the
        trajectories matrix
    increase: bool
        Direction to consider (values that increased or decreased). "Increase"
        is the default value.
    Returns
    -------

    """
    if increase:
        pad_up = (1, 0)
        pad_lo = (0, 1)
    else:
        pad_up = (0, 1)
        pad_lo = (1, 0)

    value_increased = np.pad(value_increased, ((0, 0), pad_up, (0, 0)),
                             'constant')
    value_decreased = np.pad(value_decreased, ((0, 0), pad_lo, (0, 0)),
                             'constant')

    res = np.einsum('ik,ikj->ij', output_array,
                    value_increased + value_decreased)

    return res.T
def _reorganize_output_matrix ( output_array : np . ndarray , value_increased : np . ndarray , value_decreased : np . ndarray , increase : bool = True ) -> np . ndarray : if increase : pad_up = ( 1 , 0 ) pad_lo = ( 0 , 1 ) else : pad_up = ( 0 , 1 ) pad_lo = ( 1 , 0 ) value_increased = np . pad ( value_increased , ( ( 0 , 0 ) , pad_up , ( 0 , 0 ) ) , 'constant' ) value_decreased = np . pad ( value_decreased , ( ( 0 , 0 ) , pad_lo , ( 0 , 0 ) ) , 'constant' ) res = np . einsum ( 'ik,ikj->ij' , output_array , value_increased + value_decreased ) return res . T