[GRASS-SVN] r69980 - grass-addons/grass7/raster/r.randomforest
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Dec 2 08:47:10 PST 2016
Author: spawley
Date: 2016-12-02 08:47:10 -0800 (Fri, 02 Dec 2016)
New Revision: 69980
Modified:
grass-addons/grass7/raster/r.randomforest/ml_utils.py
Log:
bug fix to r.randomforest
Modified: grass-addons/grass7/raster/r.randomforest/ml_utils.py
===================================================================
--- grass-addons/grass7/raster/r.randomforest/ml_utils.py 2016-12-02 16:34:28 UTC (rev 69979)
+++ grass-addons/grass7/raster/r.randomforest/ml_utils.py 2016-12-02 16:47:10 UTC (rev 69980)
@@ -112,7 +112,7 @@
if lowmem is False:
response_np = np.array(roi_gr)
else:
- response_np = np.memmap(os.path.join(tmpdir, 'response'),
+ response_np = np.memmap(filename=os.path.join(tmpdir, 'response'),
dtype='float32', mode='w+',
shape=(current.rows, current.cols))
response_np[:] = np.array(roi_gr)[:]
@@ -144,9 +144,9 @@
# Loop through each raster and sample pixel values at training indexes
if lowmem is True:
- feature_np = np.memmap(os.path.join(tmpdir, 'feature',
+ feature_np = np.memmap(os.path.join(tmpdir, 'feature'),
dtype='float32', mode='w+',
- shape=(current.rows, current.cols)))
+ shape=(current.rows, current.cols))
for f in range(n_features):
predictor_gr = RasterRow(predictors[f])
More information about the grass-commit
mailing list