Intel® Distribution for Python*
Engage in discussions with community peers related to Python* applications and core computational packages.
417 Discussions

daalpy_fit RuntimeError: Failed to solve the system of normal equations



I am running a list of regression models and I am getting the following:
Traceback (most recent call last):
File "/home/XXXXXX/", line 293, in
col_num=columns_num, col_cat=columns_cat, data=df_train,run_from_cache=False)
File "/home/XXXXX/", line 217, in run_regression, y_train)
File "/home/XXX/miniconda3/envs/idp3/lib/python3.6/site-packages/sklearn/linear_model/", line 366, in fit, y_subset)
File "/home/XXX/miniconda3/envs/idp3/lib/python3.6/site-packages/sklearn/daal4sklearn/", line 81, in fit
_daal4py_fit(self, X, y)
File "/home/XXX/miniconda3/envs/idp3/lib/python3.6/site-packages/sklearn/daal4sklearn/", line 20, in _daal4py_fit
lr_res = lr_algorithm.compute(X, y)
File "build/daal4py_cy.pyx", line 7445, in _daal4py.linear_regression_training.compute
RuntimeError: Failed to solve the system of normal equations

It does not happen when I run it from another virtual environment with non-intel python and sklearn

Thanks a lot.

0 Kudos
1 Reply
Thank you for reporting the problem, and apologies for the inconvenience. scikit-learn in Intel (R) Distribution for Python* is monkey-patched to use Intel Data Analytics Acceleration Library (DAAL) as the underlying solver for a subset of algorithms, including linear and Ridge regressions. DAAL provides two algorithms to solver linear regression, forming and solvign normal equation directly, or using QR decomposition of the design matrix to do it. See The default, faster method forms and solves normal equations directly. It is less numerically stable, than the slower QR method. I would suggest to regularized the normal equation using sklearn.linear_model.Ridge estimator. We will see about exposing QR method to linear regression as well.
0 Kudos