gneiss.regression.RegressionResults

class gneiss.regression.RegressionResults(stat_results, feature_names=None, basis=None, balances=None, tree=None)[source]

Summary object for storing regression results.

A RegressionResults object stores information about the individual balances used in the regression, the coefficients, residuals. This object can be used to perform predictions. In addition, summary statistics such as the coefficient of determination for the overall fit can be calculated.

Parameters:
  • stat_results (list, sm.RegressionResults) – List of RegressionResults objects.
  • feature_names (array_like, str, optional) – List of original names for features that are found in tree.
  • basis (np.array, optional) – Orthonormal basis in the Aitchison simplex. If this is not specified, then project cannot be enabled in coefficients or predict.
  • balances (np.array, optional) – A table of balances where samples are rows and balances are columns. These balances were calculated using tree.
  • tree (skbio.TreeNode) – Bifurcating tree that defines basis
__init__(stat_results, feature_names=None, basis=None, balances=None, tree=None)[source]

Methods

__init__(stat_results[, feature_names, ...])
coefficients([project]) Returns coefficients from fit.
predict([X, project]) Performs a prediction based on model.
read_pickle(filename) Reads RegressionResults object from pickle file.
residuals([project]) Returns calculated residuals.
write_pickle(filename) Writes RegressionResults object to pickle file.

Attributes

r2 Coefficient of determination for overall fit
tree Bifurcating tree used to calculate ilr transform.