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.

Decision Tree (dt) 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.

Decision boundaries

Next, we are going to define a function to plot the decision boundary.

Decision Tree (GINI)

Procedure

First, We will initialize and train a decision tree classifier.

Finally, we plot the decision trees (Gini and Entropy).

👩🏽‍💻 TEST IT OUT

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