[GRASS-SVN] r70288 - grass-addons/grass7/raster/r.learn.ml
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jan 6 12:35:56 PST 2017
Author: spawley
Date: 2017-01-06 12:35:56 -0800 (Fri, 06 Jan 2017)
New Revision: 70288
Modified:
grass-addons/grass7/raster/r.learn.ml/r.learn.ml.py
Log:
'fixed bug with grass cell nodata vals in prediction when onehot encoding'
Modified: grass-addons/grass7/raster/r.learn.ml/r.learn.ml.py
===================================================================
--- grass-addons/grass7/raster/r.learn.ml/r.learn.ml.py 2017-01-06 20:16:19 UTC (rev 70287)
+++ grass-addons/grass7/raster/r.learn.ml/r.learn.ml.py 2017-01-06 20:35:56 UTC (rev 70288)
@@ -765,7 +765,8 @@
nsamples = rowincr * current.cols
flat_pixels = img_np_row.reshape((nsamples, n_features))
- # remove NaN values
+ # remove NaN values and GRASS CELL nodata vals
+ flat_pixels[flat_pixels == -2147483648] = np.nan
flat_pixels = np.nan_to_num(flat_pixels)
# onehot-encoding
More information about the grass-commit
mailing list