Skip to content

Commit

Permalink
Make _predict() static
Browse files Browse the repository at this point in the history
  • Loading branch information
pzivich committed Aug 27, 2018
1 parent 82ac03e commit 988c4fa
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions zepid/causal/gformula/TimeVary.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ def fit(self, treatment, lags=None, sample=10000, t_max=None, in_recode=None, ou
for j in cov_model_order:
g[self._covariate[j]] = self._predict(df=g,
model=self._covariate_models[j],
variable=self._covariate_type[j],
se=self._covariate_se[j])
variable=self._covariate_type[j])
exec(self._covariate_recode[j])

# predict exposure when customized treatments
Expand Down Expand Up @@ -292,7 +291,7 @@ def fit(self, treatment, lags=None, sample=10000, t_max=None, in_recode=None, ou
self.time_in]).reset_index(drop=True)

@staticmethod
def _predict(df, model, variable, se=None):
def _predict(df, model, variable):
"""
This predict method gains me a small ammount of increased speed each time a model is fit, compared to
statsmodels.predict(). Because this is repeated so much, it actually decreases time a fair bit
Expand Down

0 comments on commit 988c4fa

Please sign in to comment.