Even though it works fine on my local (QGIS 3.8.3, Mac, Python 3.7, sklearn 0.21.3), I often encountered that error, most of the time related to floats operation (e.g np.float32 not JSON serializable)
Python Console Use iface to access QGIS API interface or Type help(iface) for more info Security warning: typing commands from an untrusted source can lead to data > loss and/or leak >> from sklearn import linear_model >> import numpy as np >> X = np.random.randint(10, size=(10, 2)) >> Y = np.random.rand(10, 1) >> X.shape, Y.shape ((10, 2), (10, 1)) >> reg = linear_model.LinearRegression().fit(X, Y) On Fri, Oct 25, 2019 at 12:30 AM Xavier Corredor Llano < [email protected]> wrote: > Hello everyone, > > I don't know if this is a bug in Qgis or it happens only to me. > > The linear_model from sklearn works perfectly outside Qgis, but when I try > to import that library inside python shell in Qgis it's not possible: > > To reproduce the error is just when you import the library like this: > from sklearn import linear_model > > The error: > RecursionError: maximum recursion depth exceeded > > Does anyone have the same problem? any ideas? > > (using Qgis 3.8.3, sklearn 0.21.3, python 3.7.4 and Archlinux) > > Xavier > _______________________________________________ > QGIS-Developer mailing list > [email protected] > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer -- *Akbar Gumbira * *www.akbargumbira.com <http://www.akbargumbira.com>*
_______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
