Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linear Regression #28

Closed
dcuervoAG opened this issue Aug 1, 2022 · 2 comments
Closed

Linear Regression #28

dcuervoAG opened this issue Aug 1, 2022 · 2 comments

Comments

@dcuervoAG
Copy link

Hi BGR,
I have a question, when I used the Linear Regression analysis, I got a problem with the following error message:
Traceback (most recent call last):
File "D:\LSAT-main\core\libs\Analysis\LogisticRegressionAnalysis.py", line 49, in run
stack, labels, stack_full, noDataArray, nr_of_unique_parameters = rasterprepwork.prepareInputData(
File "D:\LSAT-main\core\libs\Rasterprepwork\rpw_main.py", line 39, in prepareInputData
stack_red, stack = self.getstackFromCategoricalData(
File "D:\LSAT-main\core\libs\Rasterprepwork\rpw_main.py", line 114, in getstackFromCategoricalData
value_array_red = value_array[noDataArray != raster.nodata]
numpy.core._exceptions.MemoryError: Unable to allocate 629. MiB for an array with shape (1, 15577, 21186) and data type int16

However, this error does not occur when my parameters are in discrete data. So, Do I have to input the data in discrete data? or is that a error? Can I solve that issue?

@BGR-EGHA
Copy link
Owner

BGR-EGHA commented Aug 1, 2022

Hello Daniel,

I was able to recreate your error by calculating Logistic Regression with "AW3D30.tif" from the test dataset as a discrete data set.

LSAT tries to be smart when adding data sets to the calculation and guesses the type of parameter based on the data type:
int -> categorical / discrete (e.g. lithologie)
float -> continuous (e.g. slope)
If a raster with n different values is loaded as a discrete data set LSAT will create n arrays where one value is 1 and the others are 0. This will use a lot of memory if there are a lot of unique values leading to the Crash you described.

Make sure to select the corresponding type for continuous/discrete data sets.
If all it took to fix it for you was selecting continuous for that raster and your other ones work fine the wrong automatic selection is most likely the source of the crash.
If not, please share the raster data set (if possible) so I can take a closer look.

Kind regards
Nick

@dcuervoAG
Copy link
Author

dcuervoAG commented Aug 2, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants