API Reference¶
-
pysloth.
ccpd_function
(x_train_cal: numpy.ndarray, y_train_cal: numpy.ndarray, x_test: numpy.ndarray, y_grid: numpy.ndarray, k: int, n_delta: int) → Tuple[numpy.ndarray, numpy.ndarray]¶ Cross Conformal Predictive Distributions
- Parameters
x_train_cal (np.ndarray) – Train and calibration features
y_train_cal (np.ndarray) – Train and calibration target
x_test (np.ndarray) – Test features
y_grid (np.ndarray) – Target grid
k (int) – Number of fold
n_delta (int) – Number of discrete values in an interval
- Returns
Q folds and p folds
- Return type
Tuple[np.ndarray, np.ndarray]
-
pysloth.
crps_function
(y_range: numpy.ndarray, q: numpy.ndarray, y: float) → float¶ Continuously Ranked Probabilistic System
- Parameters
y_range (np.ndarray) – Range over which Q was computed
q (np.ndarray) – Distribution function
y (float) – Target
- Returns
Sum
- Return type
float
-
pysloth.
scpd_function
(x_train: numpy.ndarray, x_cal: numpy.ndarray, y_train: numpy.ndarray, y_cal: numpy.ndarray, x_test: numpy.ndarray, y_test: numpy.ndarray, y_grid: numpy.ndarray, k: int, n_delta: int, shuffle_ind: bool = True) → Tuple[numpy.ndarray, numpy.ndarray]¶ Split Conformal Predictive Distributions
- Parameters
x_train (np.ndarray) – Training features
x_cal (np.ndarray) – Calibration features
y_train (np.ndarray) – Training target
y_cal (np.ndarray) – Calibration target
x_test (np.ndarray) – Test features
y_test (np.ndarray) – Test target
y_grid (np.ndarray) – Target grid
k (int) – Number of fold
n_delta (int) – Number of discrete values in an interval
shuffle_ind (bool) – Whether to shuffle indicators (default=True)
- Returns
Output of split-conformal transducer (Q) and CRPS
- Return type
Tuple[np.ndarray, np.ndarray]