Pairwise logratio transform
pairwise_logratio(df, numerator_column, denominator_column)
Perform a pairwise logratio transformation on the given columns.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df |
DataFrame
|
The dataframe containing the columns to use in the transformation. |
required |
numerator_column |
str
|
The name of the column to use as the numerator column. |
required |
denominator_column |
str
|
The name of the column to use as the denominator. |
required |
Returns:
Type | Description |
---|---|
Series
|
A series containing the transformed values. |
Raises:
Type | Description |
---|---|
InvalidColumnException
|
One or both of the input columns are not found in the dataframe. |
InvalidParameterValueException
|
The input columns contain at least one zero value. |
Source code in eis_toolkit/transformations/coda/pairwise.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
single_pairwise_logratio(numerator, denominator)
Perform a pairwise logratio transformation on the given values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
numerator |
Number
|
The numerator in the ratio. |
required |
denominator |
Number
|
The denominator in the ratio. |
required |
Returns:
Type | Description |
---|---|
float64
|
The transformed value. |
Raises:
Type | Description |
---|---|
InvalidParameterValueException
|
One or both input values are zero. |
Source code in eis_toolkit/transformations/coda/pairwise.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|