new regressions Huber and Theil-Sen for trendline - #1763
Conversation
|
Thanks for this PR! We've been thinking about an extension mechanism for this "trendline" feature for a while, as an alternative to baking in an increasing number of types of regressions directly into the library. I was thinking of having this argument accept a function with a signature like The advantage to this function approach is that you could do something like the following: def huber(t):
def huber_impl(x_in, y_in):
# math that depends on `t`
return y_out, results, hover_string
return huber_impl
px.scatter(..., trendline=huber(t=2.222))In addition to this, I'd want to include some kind of As our first new-regression-function contributor, how does this sound as an API? |
|
Use of decorators is a great and flexible option. But it's maybe not very obvious for users. |
|
Thanks again for taking the time to submit this PR! I'm going to close it now in favour of #2418 but I will re-use this code when documenting the new pluggable interface, as examples of the kinds of things that can be done with it :) |
Hi! I've added two robust regressions for trendlines. There's an import from scipy, maybe it's not great. But I think that robust regressions will be helpful for analyzing data.