Isometric logratio transform
single_ilr_transform(df, subcomposition_1, subcomposition_2)
Perform a single isometric logratio transformation on the provided subcompositions.
Returns ILR balances. Column order matters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df |
DataFrame
|
A dataframe of shape [N, D] of compositional data. |
required |
subcomposition_1 |
Sequence[str]
|
Names of the columns in the numerator part of the ratio. |
required |
subcomposition_2 |
Sequence[str]
|
Names of the columns in the denominator part of the ratio. |
required |
Returns:
Type | Description |
---|---|
Series
|
A series of length N containing the transforms. |
Raises:
Type | Description |
---|---|
InvalidColumnException
|
One or more subcomposition columns are not found in the input dataframe. |
InvalidCompositionException
|
Data is not normalized to the expected value or one or more columns are found in both subcompositions. |
InvalidParameterValueException
|
At least one subcomposition provided was empty. |
NumericValueSignException
|
Data contains zeros or negative values. |
Source code in eis_toolkit/transformations/coda/ilr.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|