patsy
patsy copied to clipboard
Feature request: "target ~ ." syntax
R lets you regress a target against all the variables in the dataframe by simply typing "target ~ ." This is particularly useful when we have lots of columns and don't want to specify each predictor. I don't think patsy supports this yet. Any chance if it can be added? Thanks.
Just came to file this same request, so +1
+1
Another vote
https://stackoverflow.com/questions/22388498/statsmodels-linear-regression-patsy-formula-to-include-all-predictors-in-model
+1 to this feature
This feature would be great!
+1
+1
+1
+1
+1
I haven't had a chance to read through the code entirely:
This looks like it'd be a new kind of PYTHON_EXPR. https://github.com/pydata/patsy/blob/master/patsy/parse_formula.py#L68
And then maybe some code here would need to be modified - not sure of this: https://github.com/pydata/patsy/blob/master/patsy/eval.py
It should probably be a new token type, if expr_text == ".": token_type = "DOT"
or similar.
eval.py
wouldn't need any changes -- that's for evaluating Python code, and .
is not a Python expression :-). Instead you'd want to look at desc.py
, which has the code for taking a formula parse tree and converting it into termlists.
#28 ended up not getting merged, but if anyone's interested in having a go at implementing this, then there's some discussion there of the right way to do it.
+1
+1
+1
+1
+1
+1
+1000
This feature would make things easy, +1
Yes! Could not agree more.
On Jul 8, 2016, at 12:14 AM, Harika Rajavaram [email protected] wrote:
This feature would make things easy, +1
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
+1
+1
+1
+1
+1
+1
+1
+1
+2