The Stack Overflow podcast is back! Listen to an interview with our new CEO.
28

I am not sure that I understand what you mean by "collect" data. If you are referring to heads-up digitizing and assignment of classes, this is best done in a GIS. There are many free options that would be suitable (i..e, QGIS, GRASS). Ideally you would have field data to train your classification. The procedure for classification using Random Forests is ...


7

I am the main developer of MGET. The first step in your problem is to obtain values of the covariates that you will use to fit the model to your 90 GPS points. It sounds like you want to use the 8 bands as your covariates. You need to add 8 fields to your shapefile (one for each band) and populate them using a tool such as Extract Multi Values to Points ...


7

Classification algorithms such as Maximum Liklihood, random forests, and SVM are statistical methods for grouping data. These data may be words, colors, sounds or anything you can imagine. In a remote sensing context, these algorithms are used to group pixels or image objects (segments) based on statistical properties, or spectral profiles. To answer ...


6

It is really is worth the time to learn the code interface. Here is some annotated code for specifying a simple Random Forest image classification using spatial data. # Add required libraries require(randomForest) require(sp) require(rgdal) require(raster) # SET WORKING DIRECTORY setwd("D:/ANALYSIS/Kenya_Hirola/RandomForest") # Read point shapefile with ...


5

Random Forests in unlabeled (unsupervised) mode does not return explicit classes but, rather something analogous to scaled multivariate distances which is based on node proximities. Without the proximity matrix, you do not have a usable unlabeled model. And yes, for large problems, even using a sparse matrix, the very nature of the approach causes the ...


5

I would look at the support of you individual classes. If support for a given class is marginal in your fit model, the error may propagate in very undesirable ways. I would also consider fitting a series of binary models and predicting probabilities of each class separately. You could then perform a sensitivity test on the probabilities and evaluate if ...


5

It is a difficult thing that you are attempting. Small subtle changes in reflectances caused by different acquisition dates will cause major errors to arise when using your approach. You will have to do more preprocessing of your data, in order to have your approach be reliable. Normalizing the other years to your reference will most likely help, but it may ...


5

I know that this thread is a little old, but for anyone wanting to try classification of remote sensing data in R, a very promising new package has been released. install.packages("RSToolbox") It comes with functions for both unsupervised and supervised classification (using random forests). More information can be found here - http://bleutner.github.io/...


4

A classifier, any classifier, can classify any kind of data. These objects, as Aaron correctly states, can be pixels, objects, superpixels, bananas, sounds, DNA, etc. The main differences which, in my opinion, is really relevant between superpixel- and pixel-based classification are as follows: pixel based : The resolution of the prediction is maximal, ...


4

The statistics that you highlight do not care if the data is a set of discrete "objects" or individual pixel based. I would also point out that it is quite incorrect to assert that "Random Forests" or "Support Vectors" are object-based and "Maximum Likelihood" pixel based classification algorithms. The model specification is dependent on a response vector [y]...


4

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 quote the user guide on this: Intuitively, precision is the ability of the classifier not to label as positive a sample that is negative, and recall is the ...


3

In the example you are referencing, NDVI is included as a predictor variable along with all of the band values. The response variable is the class (vegetation type). In your case, you could simply have a binary response (cover, or non-cover). Random forests is a very valuable machine learning algorithm because you can incorporate any type of predictor you ...


3

Here and here are tutorials on supervised classification / regression with R, which includes a RandomForest examples.


3

You need to make sure that names(sdata@data[,3:ncol(sdata@data)]) and names(xvars) are exactly the same. Check this using identical(names(sdata@data[,3:ncol(sdata@data)]), names(xvars)) If TRUE, your predict should run fine. The edit related warnings/errors are irrelevant, they relate to you trying to display a SpatialPolygonsDataFrame (and S4 class ...


3

I think your problem is related to the layer names of your raster stack ('rasters'). Make sure these are the same as in your .csv. You can get the layer names with names(rasters) and set them with names(rasters) <- c("band1", "band2", "band3") Hope this helps TimSalabim


3

Your script is configured to take a point shapefile of training data and use that to train a Random Forest classifier. The screenshot shows the form the shapefile attribute table needs to take in order to be used as a training set. The important fields here are 1) the XY coords, 2) the pixel values for each band at that XY coordinate, and 3) the class of ...


3

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 segmentaion to generate objects, which can be the classified using SVM/random forests etc. http://wiki.awf.forst.uni-goettingen.de/wiki/index.php/Object-...


3

Why keep the entire analysis in eCognition? Once you have your image objects derived, export them and run the model in R. You have far more control of the model in R (e.g., model specification, multi-colinearty test, model selection, etc...) and there is no problem fitting a model to all of the data and predicting it to subsets represented by the tiles. I ...


3

Welcome to SE-GIS! It is great that you have read the manual (as most people often forget to do it)! As it was said in the instruction - the names of the predictors must be the same that was used for training. The name of the predictors if you use 'raster' package are generated as 'raster_name'(without extension)+'.'+'band_number', e.g. 'imagery.tif' with 2 ...


3

The raster package makes R memory safe with large rasters. There is also a very convenient raster prediction function that works with R's generic predict. Because of this you can predict a large variety of models that use the predict wrapper. The primary requirement is that a model is predicted to a stack or brick raster object. To create this type of object ...


3

Look at Basic rules for writing Python scripts for Processing Toolbox in QGIS ##input_file=file ##output_file =output file


2

"Past and present predictors RasterStack are the same extension, resolution, etc. This is not the problem." Indeed that is not the problem, as that is not a requirement. "The names in the Raster object should exactly match those expected by the model (...) so, according to this, I can't predict my model to another RasterStack that was not used to obtain the ...


2

There is a sample ruleset on the eCognition Community Ruleset Exchange that shows a work-around. Note that you may need to register to access the ruleset exchange link. The rule-set description states the following: This zip archive contains example data to train and apply the classifier algorithm on multiple scenes. At the moment you can do this ...


2

This is not the exact answer but could be used as a workaround. I guess that you are not using the 8 tiles together for memory reason, but your area seems to be quite homogeneous. So you could degrade the resolution of your images (e.g. with a factor 2 or 3) and create a mosaic. Then you train your classifier on the mosaic image and you "save to file" the ...


2

Here is an example using R and a hyperspectral AVIRIS image of the Kennedy Space Centre which is provided for testing spatial classifications. ## required packages for spatial data random forest analysis require(raster) require(rgdal) install.packages("randomForest") require(randomForest) ## download the aviris data download.file("http://www.csr.utexas....


2

One of the cool thing about random forest is that they probe at each node a random subset of the variables. The ones providing the split with best entropy (or other criteria) will be kept, while others will be discarded and possibly tested in a subsequent / different node. In very simple words, if a variable does not provide any information about the split (...


2

The RandomForests algorithm is often used in forestry. There are two implementations of the randomForests algorithm that I regularly use. The first is a pixel-based classifier implimented in R using the randomForests package. I believe this is most sophisticated and flexible approach you are likely to find. There are a many resources to get you started ...


2

I would imagine that the source of the error is that the names of your raster object "satImage" do not match the variables used in the random forests model. You can check this by using match() or %in% on the names of the two objects. x = c("t.1","t.2","t.3","t.4") y = c("t1","t.2","t.3","t.4") x %in% y If you would like to get very specific you could ...


2

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 sos package in the R shell to find packages which have Random Forest Classification functions library(sos) # find packages with Random Forest Classification ...


2

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 that you've made a transposition error some where. 49, 51 is close enough). This implies that as you stated previously, you took a sample of 50 of each of your ...


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