Topic line says it all.: are there 2- (at least) and 3-D versions of polyfit?
I assume not since I don't see it in the docs. But I'll give a bit of motivation in case that helps.
We're doing some "explainable AI" work where we're using Generalized Additive Models (GAMs) to fit data. GAMs represent functions as linear sums of non-linear basis functions.
Surprisingly, in many high (e.g. 100-) dimensional tabular settings, it is enough to model pairwise interactions, e.g.:
kdd13.pdf (microsoft.com). This ends up meaning that we fit each independent variable (and some of the pairs) separately to get the basis functions.
We currently fit with decision trees, similar to what's described in the papers, and extract the "function" corresponding to the decision trees as lookup tables by sampling them. But these are not real functions and it's clunky to e.g. find their max or do other function-y things we want to. We don't usually use polynomials because they're badly behaved. But Chebfun2s look like they may fit the bill. All we need is the ability to pairwise data.
I'd love to hear any relevant thoughts.
Thanks,
Matthai