JonasHarnau / apc

Python Package for Age-Period-Cohort and extended Chain-Ladder Analysis
GNU General Public License v3.0
17 stars 6 forks source link

ValueError: matrices are not aligned in Model.forecast() #7

Open AyanMeow opened 8 months ago

AyanMeow commented 8 months ago

https://github.com/JonasHarnau/apc/blob/4908cc16109046493413fa13053660aa9cf4e4f3/apc/Model.py#L2268

Thank you for your work on Python. Recently, I encountered a problem with mismatched matrix shapes when using it. I don't quite understand what kind of operation the ‘dot’ here is supposed to perform, as the two matrices involved in the calculation seem to be unable to match. This problem occurred on Belgian_lung_cancer.

--> fc_linpred = fc_design.dot(self.parameters['coef']).rename( 'linear_predictor_forecast') if self.family in ('poisson_response', 'od_poisson_response'): fc_point = np.exp(fc_linpred).rename('point_forecast') ValueError: matrices are not aligned

JonasHarnau commented 6 months ago

Hey @AyanMeow ,

since the last update of this repo there have been a number of apparently breaking changes in pandas (and potentially other dependencies). If you had the chance to work on fixing this please do feel free to contribute here and help address this.

Either way, thanks for raising it!