Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

241
Views
Google Earth Engine Random Forest Classifier

I am Gabriele and I tried to create a scrip for surveying (using Google Earth Engine). Precisely, I am using google earth engine to classify land cover. I found a problem using the ‘Random Forest Classifier’. My purpose is to get a result (see the row ‘gridcoll_classifier’ or the image below) with a value between 0 and 1, but I got binary values only! I attached the whole code right here:

var gridcoll = ee.FeatureCollection('users/gabrielenicolanapoli/gridcoll_merged_modified');

//Classifier
var withRandom = gridcoll.randomColumn('random');

var split = 0.7; //70% training, 30% testing.
var trainingPartition = withRandom.filter(ee.Filter.lt('random', split));
var testingPartition = withRandom.filter(ee.Filter.gte('random', split));

print(trainingPartition)

//Filtering out the null property values and try again.
//var trainingNoNulls = trainingPartition.filter(ee.Filter.notNull(trainingPartition.propertyNames()));

var ClassProperty = 'bool_str';

//Training the classifer and applying it with the filtered training collection.
var gridcoll_classifier = ee.Classifier.smileRandomForest(20).train({
  features: trainingPartition,
  classProperty: ClassProperty,
  inputProperties: ['S_mean', 'S_std']
});
print('Gridcoll Classifier', gridcoll_classifier);

var test = testingPartition.classify(gridcoll_classifier, 'gridcoll_classifier');
print('Gridcoll_test', test);

And the image with the script and the resulting asset…:

1

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You need to set the output mode of the classifier. The default for the smileRandomForest classifier is classification, which is why you get a binary output of 0 or 1.

If you want a probability score for your classification property, try this:

var gridcoll_classifier = ee.Classifier.smileRandomForest(20).train({
  features: trainingPartition,
  classProperty: ClassProperty,
  inputProperties: ['S_mean', 'S_std']
}).setOutputMode('PROBABILITY');

Other options for the output mode are listed in the documentation: https://developers.google.com/earth-engine/apidocs/ee-classifier-setoutputmode

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!