skcriteria.core.stats module

Stats helper for the DecisionMatrix object.

class skcriteria.core.stats.DecisionMatrixStatsAccessor(dm)[source]

Bases: AccessorABC

Calculate basic statistics of the decision matrix.

Kind of statistic to produce:

  • ‘corr’ : Compute pairwise correlation of columns, excluding NA/null values.

  • ‘cov’ : Compute pairwise covariance of columns, excluding NA/null values.

  • ‘describe’ : Generate descriptive statistics.

  • ‘kurtosis’ : Return unbiased kurtosis over requested axis.

  • ‘mad’ : Return the mean absolute deviation of the values over the requested axis.

  • ‘max’ : Return the maximum of the values over the requested axis.

  • ‘mean’ : Return the mean of the values over the requested axis.

  • ‘median’ : Return the median of the values over the requested axis.

  • ‘min’ : Return the minimum of the values over the requested axis.

  • ‘pct_change’ : Percentage change between the current and a prior element.

  • ‘quantile’ : Return values at the given quantile over requested axis.

  • ‘sem’ : Return unbiased standard error of the mean over requested axis.

  • ‘skew’ : Return unbiased skew over requested axis.

  • ‘std’ : Return sample standard deviation over requested axis.

  • ‘var’ : Return unbiased variance over requested axis.

corr(method='kendall', **kwargs)[source]

Compute pairwise correlation of criteria columns.

By default the Kendall rank correlation coefficient (tau) is used, which is appropriate for ordinal or non-normally distributed data.

Parameters:
  • method (str or callable, default "kendall") – Method of correlation. Accepted values are "pearson", "kendall", "spearman", or a callable with signature (Series, Series) -> float. See pandas.DataFrame.corr() for details.

  • kwargs – Other keyword arguments are passed to the underlying pandas.DataFrame.corr() method.

Returns:

Symmetric DataFrame of shape (n_criteria, n_criteria) with the pairwise correlation coefficients between criteria. Diagonal entries are 1.0.

Return type:

pd.DataFrame

See also

DecisionMatrixStatsAccessor.cov

Pairwise covariance of criteria.

mad(axis=0, skipna=True)[source]

Return the mean absolute deviation of the values over a given axis.

Parameters:
  • axis (int) – Axis for the function to be applied on.

  • skipna (bool, default True) – Exclude NA/null values when computing the result.