You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current implementation of eval_poly() provides the final value of the given polynomial. However, to compare with typical XAI methods that provide feature importance in a local manner, such as SHAP values for a given observation, it would be nice to be able to compute the value of each monomial in the polynomial for a given observation.
As an example, having the polynomial $3+ 2x_1 - x_2 +4x_1x_2$ evaluated on $x=(1,1)$, would be $3 + 2 - 1 + 4$, where each of those values is the contribution of each monomial evaluated on the given point $x$.
Output dimension discussion
Currently, eval_poly() receives poly$values as a matrix, where each column represents a polynomial (all with the same terms) and each row is a given monomial in all those polynomials. It also receives a newdata item that can be a matrix or a dataframe where the columns are the variables or features and the rows the observations or instances.
Then, the output of eval_poly is built as a matrix with polynomials as columns (matching the columns in poly$values notation) and observations as rows (matching the rows in newdata notation).
However, a function that can compute monomial values as suggested needs to have a 3D output, as it would need to keep the different polynomials and observations dimensions as before, but also the monomials dimension, given by the rows in poly$values. An array with 3 dimensions seems the best option, where the dimensions could be c(n_observations, n_monomials, n_polynomials), so for the polynomial k, element [ , ,k] will be a matrix with observations as rows and monomials as columns.
The text was updated successfully, but these errors were encountered:
Current implementation of
eval_poly()
provides the final value of the given polynomial. However, to compare with typical XAI methods that provide feature importance in a local manner, such as SHAP values for a given observation, it would be nice to be able to compute the value of each monomial in the polynomial for a given observation.As an example, having the polynomial$3+ 2x_1 - x_2 +4x_1x_2$ evaluated on $x=(1,1)$ , would be $3 + 2 - 1 + 4$ , where each of those values is the contribution of each monomial evaluated on the given point $x$ .
Output dimension discussion
Currently,
eval_poly()
receivespoly$values
as a matrix, where each column represents a polynomial (all with the same terms) and each row is a given monomial in all those polynomials. It also receives anewdata
item that can be a matrix or a dataframe where the columns are the variables or features and the rows the observations or instances.Then, the output of
eval_poly
is built as a matrix with polynomials as columns (matching the columns inpoly$values
notation) and observations as rows (matching the rows innewdata
notation).However, a function that can compute monomial values as suggested needs to have a 3D output, as it would need to keep the different polynomials and observations dimensions as before, but also the monomials dimension, given by the rows in
poly$values
. An array with 3 dimensions seems the best option, where the dimensions could bec(n_observations, n_monomials, n_polynomials)
, so for the polynomialk
, element[ , ,k]
will be a matrix with observations as rows and monomials as columns.The text was updated successfully, but these errors were encountered: