New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP/ENH: adding support for categorial factors #527
Conversation
- added privat _recode function that internally recodes the x factor - added additional positional argument, a dict that allows the user to specify the remapping done by _recode - i would have prefered a kwarg but this however messes up the ax.plot below. The options i see whithin this approach are a) allowing users to optinoally pass a tuple like (x, x_levels). so no additional positional argument is required and b) explicitly passing a dict with plotting parameters instead of **kwargs Wdyt?
@@ -4,7 +4,7 @@ | |||
import utils | |||
|
|||
|
|||
def interaction_plot(x, trace, response, func=np.mean, ax=None, plottype='b', | |||
def interaction_plot(x, trace, response, x_levels, func=np.mean, ax=None, plottype='b', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we okay with adding args like this? I don't much mind, but it breaks backwards compatibility.
Do you think we really need the x_levels argument? Couldn't we just check the dtype in the plot and call _recode with some default levels e.g., range(n_unique)? Thoughts? |
On 24.10.2012, at 23:21, Skipper Seabold notifications@github.com wrote: Hi,
D
|
Sure. We can update the ticklabels with the categories though, so this may alleviate some of this - they'll never see the levels. Now if you really want to control treatment on left, etc. you might be better off rolling your own plot? |
On 25.10.2012, at 00:02, Skipper Seabold notifications@github.com wrote:
|
just a generic comment: It takes me 5 minutes to understand what the argument names mean, even with reading the doc string. |
indeed, something got messed up in the doc string. i'll update the commit in the course of the next days to reflect the current state of the discussion. On 25.10.2012, at 18:55, Josef Perktold notifications@github.com wrote:
|
... or did you refer to the arg names in general (pre-commit)? On 25.10.2012, at 18:55, Josef Perktold notifications@github.com wrote:
|
in general, I think already before your changes. (factor1, factor2, response) in general: x1 could be continuous if we have continuous-categorical interaction. I'm reading the function completely out of context and never tried it, so it's not obvious to me what this means, except for the basic doc string example. I don't have a comment about the pull request directly, since I haven't figured out the levels and labels yet. (busy with other things.) |
Closing this one, continued on clean PR. |
This relates to our recent discussion on the mailing list
Wdyt?