nextgis / qgis_molusce

Modules for Land Use Change Simulations
https://github.com/nextgis/molusce
GNU General Public License v2.0
43 stars 15 forks source link

Error with Logistic Regression #32

Open FelipeGarridoM opened 5 years ago

FelipeGarridoM commented 5 years ago

Hello, first of all thanks for providing this tool. I simulated a land use change with the following characteristics: 6 explanatory variables, a 2007 raster and a 2014 raster. It seems that I have a problem with the training algorithm. When I trained the model with Logistic Regression, 2 pixels neighbour, 100 iterations max. and only 10 samples it worked perfect. (obviously 10 samples points are way too little, I just did it to see if it could read well and process every step). But when I tried to train the same land use change with the same explanatory variables, but changing the sample size from 10 to 1000, after training the model, there was an attribute error: 'NoneType' object has no attribute 'T'. In short words, once it finished the training, it tried to show coefficients of the model, so it went to get them with the function model.getCoef(), which eventually called self.logreg.get_weights().T but that function did not return anything. Why is that? It is particularly weird that it worked fine for 10 samples but it couldn't do it for 1000 samples. Please help me, i dont know what else to do.

The traceback is as follows:

File "C:/Users/kmdua/.qgis2/python/plugins\molusce\logisticregressionwidget.py", line 115, in __trainFinished self.showCoefficients() File "C:/Users/kmdua/.qgis2/python/plugins\molusce\logisticregressionwidget.py", line 131, in showCoefficients coef = model.getCoef() File "C:/Users/kmdua/.qgis2/python/plugins\molusce\algorithms\models\lr\lr.py", line 65, in getCoef return self.logreg.get_weights().T AttributeError: 'NoneType' object has no attribute 'T'