patsy icon indicating copy to clipboard operation
patsy copied to clipboard

Feature request: "target ~ ." syntax

Open szs8 opened this issue 11 years ago • 38 comments

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.

szs8 avatar Oct 29 '12 03:10 szs8

Just came to file this same request, so +1

jseabold avatar May 01 '13 20:05 jseabold

+1

ltrabuco avatar Feb 02 '14 04:02 ltrabuco

Another vote

https://stackoverflow.com/questions/22388498/statsmodels-linear-regression-patsy-formula-to-include-all-predictors-in-model

jseabold avatar Mar 13 '14 22:03 jseabold

+1 to this feature

CamDavidsonPilon avatar Apr 28 '14 17:04 CamDavidsonPilon

This feature would be great!

rowanv avatar May 29 '14 01:05 rowanv

+1

idrisr avatar Sep 21 '14 16:09 idrisr

+1

yw5aj avatar Nov 18 '14 03:11 yw5aj

+1

makmanalp avatar Dec 04 '14 16:12 makmanalp

+1

clarkfitzg avatar Jan 07 '15 02:01 clarkfitzg

+1

nicke5012 avatar Feb 24 '15 01:02 nicke5012

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

makmanalp avatar Mar 02 '15 21:03 makmanalp

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.

njsmith avatar Mar 03 '15 05:03 njsmith

+1

dankessler avatar Dec 27 '15 18:12 dankessler

+1

eriklarson avatar Mar 04 '16 08:03 eriklarson

+1

michelleowen avatar Mar 16 '16 20:03 michelleowen

+1

ao1 avatar Apr 30 '16 14:04 ao1

+1

irinfox avatar May 10 '16 12:05 irinfox

+1

carojasq avatar May 11 '16 21:05 carojasq

+1000

joeitaliand avatar May 29 '16 00:05 joeitaliand

This feature would make things easy, +1

harikarajavaram avatar Jul 08 '16 05:07 harikarajavaram

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.

joeitaliand avatar Jul 08 '16 05:07 joeitaliand

+1

FayolChang avatar Sep 22 '16 05:09 FayolChang

+1

JDallasGriffin avatar Oct 20 '16 19:10 JDallasGriffin

+1

mrandrewandrade avatar Feb 13 '17 01:02 mrandrewandrade

+1

sdmurff avatar Feb 15 '17 17:02 sdmurff

+1

whryan avatar Feb 23 '17 17:02 whryan

+1

eric-czech avatar Jun 30 '17 10:06 eric-czech

+1

ghost avatar Jul 25 '17 17:07 ghost

+1

apachaves avatar Aug 30 '17 10:08 apachaves

+2

mcastillon avatar Sep 26 '17 01:09 mcastillon