uadapy package
Subpackages
- uadapy.data package
- Submodules
- uadapy.data.data module
fetch_covtype_distributions_normal()generate_synthetic_gmm()generate_synthetic_timeseries()load_breast_cancer()load_breast_cancer_normal()load_digits_normal()load_iris()load_iris_gmm()load_iris_normal()load_student_grades()load_wine()load_wine_normal()make_blobs_distributions()make_blobs_distributions_normal()make_circles_distributions()make_circles_distributions_normal()make_classification_distributions_normal()make_gaussian_quantiles_data()make_gaussian_quantiles_normal()make_hastie_10_2_distributions()make_hastie_10_2_distributions_normal()make_moons_distributions()make_moons_distributions_normal()
- uadapy.data.data module
- Module contents
- Submodules
- uadapy.distributions package
- uadapy.dr package
- uadapy.plotting package
- Submodules
- uadapy.plotting.distribution_plot module
- uadapy.plotting.interactive_splom module
- uadapy.plotting.plots_1d module
- uadapy.plotting.plots_2d module
- uadapy.plotting.plots_nd module
- uadapy.plotting.plots_timeseries module
- uadapy.plotting.shepard_diagram module
- uadapy.plotting.stippling module
- uadapy.plotting.utils module
- Module contents
- Submodules
Submodules
Module contents
Bases:
objectClass for managing and analyzing correlated distributions or time series.
List of individual distributions or timeseries.
- Type:
list[Distribution] or list[Timeseries]
Number of distributions or timeseries.
- Type:
int
Pairwise covariance matrix of the distributions.
- Type:
np.ndarray
Returns the covariance matrix between two distributions.
- Parameters:
dim_i (int) – Index of the first distribution.
dim_j (int) – Index of the second distribution.
- Returns:
Covariance matrix between i-th and j-th distribution.
- Return type:
np.ndarray
Returns the mean of the i-th distribution.
- Parameters:
dim_i (int) – Index of the distribution.
- Returns:
Mean of the i-th distribution.
- Return type:
float
Samples from the joint distribution of all correlated distributions in block structure.
- Parameters:
n_samples (int) – Number of samples to draw.
seed (int, optional) – Seed for random number generation.
- Returns:
Samples from the joint distribution.
- Return type:
np.ndarray
- class uadapy.Distribution(model, name='', n_dims=1)
Bases:
objectThe Distribution class provides a consistent interface to a variety of distributions.
- model
The underlying concrete distribution model, a scipy.stats distribution object or an array of samples
- name
Name of the distribution type, e.g. ‘Normal’
- Type:
str
- n_dims
Dimensionality of the distribution
- Type:
int
- cdf(x: ndarray | float) ndarray | float
Computes the cumulative density function.
- Parameters:
x (np.ndarray or float) – The position where the cdf should be evaluated.
- Returns:
Cumulative probability values of the distribution at the given sample points.
- Return type:
np.ndarray or float
- cov() ndarray | float
Covariance of the distribution.
- Returns:
Covariance of the distribution.
- Return type:
np.ndarray or float
- kurt() ndarray | float
Kurtosis of the distribution.
- Returns:
Kurtosis of the distribution.
- Return type:
np.ndarray or float
- marginal(dims, kde=None, n_samples_kde=1000, noise_level=0.0, seed=None)
Marginalizes the distribution retaining the specified dimensions.
- Parameters:
dims (int or list of int or ndarray) – The dimensions to retain in the marginal distribution.
kde (str, optional) – If ‘KDE’ or ‘kde’, a KDE estimation of the marginal is performed. If ‘KDE?’ or ‘kde?’, a fallback to KDE is performed if the model does not have a marginal method. Default is None, and an error is raised if the model does not have a marginal method.
n_samples_kde (int, optional) – Number of samples to use for the marginal estimation via KDE. Default is 1000.
noise_level (float, optional) – Level of uniform noise to be applied to the samples before KDE estimation. Default is 0.0.
seed (int, optional) – Seed for the random number generator for reproducibility. Default is None.
- mean() ndarray | float
Expected value of the distribution.
- Returns:
Expected value of the distribution.
- Return type:
np.ndarray or float
- pdf(x: ndarray | float) ndarray | float
Computes the probability density function.
- Parameters:
x (np.ndarray or float) – The position where the pdf should be evaluated.
- Returns:
Probability values of the distribution at the given sample points.
- Return type:
np.ndarray or float
- sample(n: int, seed=None) ndarray
Creates samples from the distribution.
- Parameters:
n (int) – Number of samples.
seed (int | rng, optional) – Seed for downstream RNG, or specific RNG to be used. Default is None.
- Returns:
Samples of the distribution.
- Return type:
np.ndarray
- skew() ndarray | float
Skewness of the distribution.
- Returns:
Skewness of the distribution.
- Return type:
np.ndarray or float
- class uadapy.TimeSeries(model, timesteps=None, name='', n_dims=1)
Bases:
objectThe TimeSeries class provides a consistent interface to model an uncertain, univariate time series. It strongly builds on the Distribution class. It provides wrapper functions to some of the important functions of the Distribution class and adds additional convenience functions that are commonly used in time series.
- distribution
The underlying distribution of the time series
- Type:
- timesteps
The time steps of the time series
- Type:
int
- cov() ndarray | float
Covariance of the time series.
- Returns:
Covariance of all time series points.
- Return type:
np.ndarray or float
- mean() ndarray | float
Expected value of the time series.
- Returns:
Expected value of the time series.
- Return type:
np.ndarray or float
- pdf(x: ndarray | float) ndarray | float
Computes the probability density function based on the whole probability distribution of the time series.
- Parameters:
x (np.ndarray or float) – The position where the pdf should be evaluated.
- Returns:
Probability values of the distribution at the given sample points.
- Return type:
np.ndarray or float
- sample(n: int, seed: int = None) ndarray
Creates samples from the time series (one specific instance).
- Parameters:
n (int) – Number of samples (time series).
seed (int, optional) – Seed for the random number generator for reproducibility, default is None.
- Returns:
Time series instances that represent samples of the distribution.
- Return type:
np.ndarray
- variance() ndarray | float
Variance of the time series.
- Returns:
Variance of the time series.
- Return type:
np.ndarray or float