Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Random Forest (rf) Classifier

Data

  1. We load training areas from data/training_areas_ml.geojson.

  2. Spectral band values (Green, Red, NIR) are simulated from class-specific reflectance profiles.

  3. The binary target is already encoded: ml_label = 1 (Corn/Maize) vs ml_label = 0 (Non-Corn).

  4. We normalize the features to [0, 1] and split into training and testing sets.

Function for decision boundaries

Next, we are going to define a helper function to plot the decision boundary for a 2D dataset.

Comparing RF Decision Boundaries

👩🏽‍💻 TEST IT OUT

How about if we want to check for 5 classes? Try it out with training_areas.geojson.