@@ -85,6 +85,18 @@ def __init__(self, x, y, intercept=True, labels=None,
85
85
@classmethod
86
86
def from_formula (cls , formula , data , priors = None , vars = None ,
87
87
name = '' , model = None , offset = 0. , eval_env = 0 ):
88
+ """Creates linear component from `patsy` formula.
89
+
90
+ Parameters
91
+ ----------
92
+ formula : str - a patsy formula
93
+ data : a dict-like object that can be used to look up variables referenced
94
+ in `formula`
95
+ eval_env : either a `patsy.EvalEnvironment` or else a depth represented as
96
+ an integer which will be passed to `patsy.EvalEnvironment.capture()`.
97
+ See `patsy.dmatrix` and `patsy.EvalEnvironment` for details.
98
+ Other arguments are documented in the constructor.
99
+ """
88
100
import patsy
89
101
eval_env = patsy .EvalEnvironment .capture (eval_env , reference = 1 )
90
102
y , x = patsy .dmatrices (formula , data , eval_env = eval_env )
@@ -142,6 +154,15 @@ def __init__(self, x, y, intercept=True, labels=None,
142
154
def from_formula (cls , formula , data , priors = None ,
143
155
vars = None , family = 'normal' , name = '' ,
144
156
model = None , offset = 0. , eval_env = 0 ):
157
+ """
158
+ formula : str - a `patsy` formula
159
+ data : a dict-like object that can be used to look up variables referenced
160
+ in `formula`
161
+ eval_env : either a `patsy.EvalEnvironment` or else a depth represented as
162
+ an integer which will be passed to `patsy.EvalEnvironment.capture()`.
163
+ See `patsy.dmatrix` and `patsy.EvalEnvironment` for details.
164
+ Other arguments are documented in the constructor.
165
+ """
145
166
import patsy
146
167
eval_env = patsy .EvalEnvironment .capture (eval_env , reference = 1 )
147
168
y , x = patsy .dmatrices (formula , data , eval_env = eval_env )
0 commit comments