Skip to main content
5 votes

Generating prediction raster from Random Forest model using R?

Just a quick note on this "problem". When you read in a raster, be it a single raster on in a stack/brick, the default names are the names of the on-disk files. In using the raster::predict function ...
Jeffrey Evans's user avatar
5 votes
Accepted

SMILE classifiers/regressors in Earth Engine

The "Smile"-named classifiers in Earth Engine are basically the Smile v1 (we're not yet at Smile v2) classifiers, with the parameter names changed to match existing Earth Engine usage, and a ...
William Rucklidge's user avatar
4 votes
Accepted

Low Recall for Radar Image Flood Classification

Welcome to the trenches of classification, probability and statistics ;) . Assuming you used sklearn, it has a detailed user guide on what metrics it provides to evaluate your classifications: I'll ...
Senshi's user avatar
  • 1,767
4 votes
Accepted

Generating prediction raster from Random Forest model using R?

After more closely inspecting the structure of all objects generated by the code above, I found the issue. For whatever reason, stack() was changing the names of the raster layers back to their ...
lambertj's user avatar
  • 3,037
4 votes
Accepted

Google Earth Engine Classification with high-res. NAIP-Orthofotos

Your property 'orthofoto' is a computedObject, not an image. You can specify the property as an image by: var orthofoto = ee.Image(listOfImages.get(1)) Alternatively, if it works for your project, ...
hooge048's user avatar
  • 794
3 votes
Accepted

GLCM measure in an object-based classification?

Short answer: Yes, you can use GLCM in RF classification. If you want to implement an OBIA analysis in R, you need to create a DF where each row is an object. Also, the final predict is applied over a ...
aldo_tapia's user avatar
  • 13.7k
3 votes

Splitting up a region into training data and validation data for Landsat7 classification

Use randomColumn(columnName, seed), which adds a column of random values between 0 and 1 to the featurecollection. Then filter on <0.2 and >0.2 to get 20% for validation, 80% for testing. // Make ...
Kuik's user avatar
  • 10.1k
3 votes

Classify polygons with Random Forest on Python

You've already assigned the "scikit-learn" tag so I assume you want to use this library. Good choice. But at first you need something to open a shapefile and extract attributes. I would recommend ...
dmh126's user avatar
  • 6,752
3 votes

Load (input) and Save (output) rds files with R in QGIS script

Look at Basic rules for writing Python scripts for Processing Toolbox in QGIS ##input_file=file ##output_file =output file
gene's user avatar
  • 55.1k
3 votes
Accepted

Calculate variable importance for classifications in Google Earth Engine

No easy easy way to compute variable importance (yet) but you could try computing your accuracy multiple times, withholding one column each time. The largest decrease in accuracy will correspond to ...
Noel Gorelick's user avatar
3 votes

Multispectral image segmentation for natural-resources applications using R

This may be easier using the Orfeo toolbox (https://www.orfeo-toolbox.org/), this is provided with OSgeo4W and can be accessed usign QGIS or a command line interface. This tutorial uses mean shift ...
Tom Higginbottom's user avatar
3 votes

Raster image error when entering stack layers using Rstudio

You are trying to read raster data with read_csv: library(readr) img1 <- read_csv("E:/Topic_sinkholes/Final data/stack layers/img1.hdr") You've not told us where you got this file from ...
Spacedman's user avatar
  • 64.7k
3 votes
Accepted

Normalising image bands in google earth engine before classification

I think any built-in algo in GEE can handle different scale features so different scale should not be a problem. But since this is also a machine learning algorithm providing a common distribution is ...
mohit kaushik's user avatar
3 votes
Accepted

How to add a randomColumn to a Feature Collection while maintaining strata in Google Earth Engine?

The random numbers from randomColumn are uniformly distributed. That means just taking 30% of the whole collection will take 30% of each strata, to within a small statistical margin. You can tell ...
Noel Gorelick's user avatar
3 votes
Accepted

Problems putting transformed predictions from Random Forest back into raster format in R

The raster package allows to predict using a RandomForest model directrly over the RasterStack containing the predictors. Suppose the rf_model variable contains your fitted model (classification model)...
sermomon's user avatar
  • 974
3 votes
Accepted

What formula does GEE use for calculation of Importance in Random Forest?

As I recall that one issue with the GEE implementation of Random Forests is that it returns the non-permuted Decrease in Gini impurity index, which is quite incorrect to base inference on. One should ...
Jeffrey Evans's user avatar
2 votes

Random Forest classification not in R

1) Random Forest classification not in R You don't know R. R is Open Source with many many books and tutorials to learn it and a strong support from the R community. I use generally first the ...
gene's user avatar
  • 55.1k
2 votes
Accepted

Confusion Matrix R

So for tl;dr answer to your question, No. Long answer: The 33..57; your rowsums, these are your models results. Notice that your colsums do add up to 50/class (except the last two, but I assume ...
SeldomSeenSlim's user avatar
2 votes

Performing Random Forest using EnMap Box?

With the imageRF, you can use as many variables or layers as you want, you just need to have them stacked up together in one (ENVI) file. Then, you parameterize your model using that layer stack. ...
rsGIS's user avatar
  • 21
2 votes

Random Forest Classification of Landsat8 Image gives invalid/noise output

You stated: I used randomly generated points and collected pixels from Maximum Likelihood Classification from ArcGIS 10.3 which was used as training dataset. I suspect creating training data ...
Aaron's user avatar
  • 51.7k
2 votes

Is the Random Trees Classifier in ArcMap 10.5 equal to Random Forest?

Based on this quote: "Creates models and generates predictions using an adaptation of Leo Breiman's random forest algorithm" from the ESRI function documentation I would not assume that the algorythm ...
Jeffrey Evans's user avatar
2 votes

Leaving Image Objects that are Uncertain to be a Particular Class as 'Unclassified' in eCognition

If you are using a random forest classifier then the inputs/outputs should be derived from that and not eCognition. In that case, RF will not be able to decide to leave data unclassified as far as I ...
Masjo's user avatar
  • 316
2 votes
Accepted

Load (input) and Save (output) rds files with R in QGIS script

In addition of @gene answer... You should train your model inside R-Qgis script. Because if layer names are different, the script will raise an error. Reproducible example (in R): library(raster) ...
aldo_tapia's user avatar
  • 13.7k
2 votes

Probability of variable importance calculation error in Google Earth Engine

Stumbled over the same problem and finally found out that in the description of the ee.Classifier.mode() another option is listed: MULTIPROBABILITY. Used this and it seemed to work, at least I was ...
s6hebern's user avatar
  • 1,236
2 votes
Accepted

Calculate new band for satellite image after predict values with RF

The output will maintain the same order as it was predicted. You can use pd.concat to join it back to the original data on axis = 1. # Re-run random forest using all the data we have available in our ...
Pdavis327's user avatar
  • 960
2 votes
Accepted

Combining imagery, masking and sampling in Descartes Labs Platform

To run at scale, rather than calling .compute in a for-loop over each tile, you can submit all the tiles to the backend at once to run in parallel as Workflows Jobs, then asynchronously process them ...
caitlin kontgis's user avatar
2 votes

Can we use "evaluate" function for other models not included in dismo package?

In looking at help and the source for dismo::evaluate function the model argument will accept any model that has a predict method. You can also just pass the function the estimated probabilities for ...
Jeffrey Evans's user avatar
2 votes

"User memory limit exceeded" using Random Forest classification

As the FeatureCollection you want to classify is not shared, it's hard to tell whether the number of features is the problem. But unless you have hundreds of thousands of points, I don't think the ...
hooge048's user avatar
  • 794
2 votes
Accepted

Error in random forest regression (Output of image computation is too large (25 bands for 903440 pixels = 106.8 MiB > 80.0 MiB)

The error message you got was quite accurate. Increase the tileScale in your reduceRegions() call. I set it to 16 (the max value), and your script ran. var training = S2_composite.select(bands)....
Daniel Wiell's user avatar
  • 14.3k
2 votes
Accepted

Random forest classifcation for Sentinel-2 low out of bag but high prediction error

The problem is in the GLCM features. You are adding some kind of spatial autocorrelation between the samples. In the glcm package GLCM features are calculated from a moving window. As the window size ...
sermomon's user avatar
  • 974

Only top scored, non community-wiki answers of a minimum length are eligible