pliers.diagnostics.Diagnostics

class pliers.diagnostics.Diagnostics(data, columns=None)[source]

Bases: object

__init__(data, columns=None)[source]
defaults = {'ColumnMahalanobisDistances': <function Diagnostics.<lambda>>, 'ConditionIndices': <function Diagnostics.<lambda>>, 'CorrelationMatrix': <function Diagnostics.<lambda>>, 'Eigenvalues': <function Diagnostics.<lambda>>, 'RowMahalanobisDistances': <function Diagnostics.<lambda>>, 'VIFs': <function Diagnostics.<lambda>>, 'Variances': <function Diagnostics.<lambda>>}

Class for holding diagnostics of a design matrix

flag(diagnostic, thresh=None)[source]

Returns indices of diagnostic that satisfy (return True from) the threshold predicate. Will use class-level default threshold if None provided.

Parameters
  • diagnostic (str) – name of the diagnostic

  • thresh (func) – threshold function (boolean predicate) to apply to

  • element (each) –

flag_all(thresh_dict=None, include=None, exclude=None)[source]

Returns indices of (rows, columns) that satisfy flag() on any diagnostic. Uses user-provided thresholds in thresh_dict/

Parameters
  • thresh_dict (dict) – dictionary of diagnostic->threshold functions

  • include (list) – optional sublist of diagnostics to flag

  • exclude (list) – optional sublist of diagnostics to not flag

summary(stdout=True, plot=False)[source]

Displays diagnostics to the user

Parameters
  • stdout (bool) – print results to the console

  • plot (bool) – use Seaborn to plot results