2

Below is Fixed Effect Estimation python code by linearmodels module from here.

from linearmodels import PanelOLS mod = PanelOLS(y_train, x_train, entity_effects=True) res = mod.fit(cov_type='clustered', cluster_entity=True)

How can we do predict(x_test) operation as sklearn after mod.fit() ?

ybdesire
  • 1,593
  • 1
  • 20
  • 35
  • try `res.predict(x_test)` – skrubber Dec 05 '17 at 03:22
  • Thanks @skrubber. There is no `predict()` function for `res` object. – ybdesire Dec 05 '17 at 03:31
  • oh yeah predict was defined for statsmodels. Spotchecked examples from [here](https://github.com/bashtage/linearmodels/tree/master/examples) and looks like a predict function doesn't exist. For your use case, if you choose linearmodels, I think you have to forego predict. Also, why do you want to use linearmodels and then predict with sklearn, when you know that the regression models and sensitivity is totally different for both? – skrubber Dec 05 '17 at 03:40
  • I need the `fixed effect model`, `random effect model` and `mixed effect model` at linearmodels. You can refer to [here](https://stackoverflow.com/questions/47645480/what-is-best-python-module-for-panel-data-regressionfixed-effect-model-random) for more details about my case. – ybdesire Dec 05 '17 at 05:37

1 Answers1

1

Conformed with the author that linearmodels still not support the function predict(), the development of this feature is in progress. Refer to here for more details.

ybdesire
  • 1,593
  • 1
  • 20
  • 35