Exercise 2: Predict spatial pattern changes
Technical note
The Presence-Only Prediction (MaxEnt) tool requires that you have a minimum of 8 GB RAM/Memory available, but we recommend closer
to 32 GB.
Depending on your computer's hardware, running this prediction model could take up to 20 minutes. For this reason, you may choose to not
run the model during the exercise and instead use the result files that are provided. See the exercise for further instructions.
Software requirements
· ArcGIS Online
· ArcGIS Pro 3.6
· ArcGIS Spatial Analyst extension
Introduction
In many parts of Africa, food and income security are tied to the agricultural production of maize. However, as a result of climate change and its
related impacts, food security for many vulnerable populations is diminishing.
In the previous exercise, you prepared a training dataset for the Presence-Only Prediction (MaxEnt) tool, which will be used to model current
and future suitability using baseline variables against the SSP3 7.0 climate scenario for 2055. After a training dataset of presence points and
explanatory variables is created, the model is ready to be trained. And, once trained, the model can be run using projected explanatory
variables to predict future conditions.
Scenario
Imagine the following scenario: You are continuing your work as a GIS analyst for a global nonprofit organization in Africa. As part of the
agricultural ministers' efforts to protect farmers and safeguard food security, you want to use your training dataset for the Presence-Only
Prediction (MaxEnt) tool to create an output that models future maize suitability.
In the previous exercise, you completed the Prepare Presence Data step of the workflow to prepare your training dataset. Therefore, in this
exercise, your task is to complete the remaining steps: create prediction points, train the model, run the model to predict maize suitability in
Africa, and, finally, review the model diagnostics and results of your model.
After preparing your presence data, you will complete the workflow for your presence-only prediction model.
Note: Depending on your computer's hardware, running this prediction model could take up
to 20 minutes. For this reason, you may choose to not run the model during the
exercise and instead, where instructed, use the provided result files.
Note: The exercises in this course include View Result links. Click these links to confirm that your
results match what is expected.
Estimated completion time in minutes: 100 minutes
Expand all steps Collapse all steps
- Step 1: Create prediction points
First, you will create the prediction points required to run your model.
The first step is to create prediction points.
A training dataset is used to teach a model to perform a task, such as prediction. To train a model, you must first run the tool using the
training dataset and baseline explanatory variables. To create a presence-only prediction model, you must then run the tool a second
time using prediction points and future explanatory variables.
In this step, you will create the prediction points for your model.
a If necessary, open your MaizePredictionModeling project.
- Hint
Start ArcGIS Pro and, under Recent Projects, click MaizePredictionModeling.
Note: If you did not download the project, go to the previous exercise, Prepare data for a prediction
model, and follow the instructions in Step 1: Download the exercise data files to download
and open the MaizePredictionModeling ArcGIS Pro project.
b In the Contents pane, turn off the PresencePoints layer.
You will use the GFSAD_Maize layer to create the prediction points. However, this layer covers the entire globe, so you will first clip it to
the study area in Africa.
c In the Geoprocessing pane, search for and open the Extract By Mask (Spatial Analyst Tools) tool.
d For Input Raster, choose GFSAD_Maize.
e For Input Raster Or Feature Mask Data, choose StudyArea.
f For Output Raster, type GFSAD_Maize_Clip.
g Leave the remaining default parameters and click Run.
Step 1g: Create prediction points.
The colors on your map may vary.
You have defined a study area for your prediction points by clipping the GFSAD_Maize layer to only the region of Africa that is your
study area.
Now you can create the prediction points for your study area using the GFSAD_Maize_Clip layer. You will use the GFSAD_Maize_Clip
layer to create a point for each pixel, or cell, of the raster layer. Each cell in the GFSAD layer measures 1 square kilometer. This region
of Africa measures approximately 5.2 million square kilometers; therefore, by converting your raster layer to points, you will end up with
approximately 5,200,000 points. This conversion may take a few minutes to process in ArcGIS Pro depending on your computer's
processing power.
h In the Geoprocessing pane, search for and open the Raster To Point (Conversion Tools) tool.
i For Input Raster, choose GFSAD_Maize_Clip.
j For Field, confirm that Value is selected.
k For Output Point Features, type PredictionPoints.
l At the bottom of the map, click the Pause Drawing button .
Step 1l: Create prediction points.
By pausing the map display, you can run the tool but not draw the 5.2 million points on the map. You only need the points as input for
the model—you do not need to visualize them on the map.
m Click Run.
n After the tool finishes running, in the Contents pane, turn off the PredictionPoints layer.
o At the bottom of the map, click the Pause Drawing button to resume the map display.
You have created the prediction points for your presence-only prediction model.
p Save your project.
Collapse
- Step 2: Add bioclimate data to prediction points
After creating prediction points for the presence-only prediction model, explanatory variables need to be added to each point. The
training dataset only uses baseline variables as explanatory variables to establish the baseline presence for the model. The dataset
used for prediction uses both baseline and projected variables so that the model can predict future suitability.
In this step, you will finalize your prediction points by adding both the baseline bioclimate variables and the projected bioclimate
variables from the climate scenario for 2055. To create the training dataset, you will use the same workflow that you used to extract the
baseline bioclimate variable values to your presence points.
a In the Geoprocessing pane, search for and open the Extract Multi Values To Points (Spatial Analyst Tools) tool.
b For Input Point Features, choose PredictionPoints.
c For Input Rasters, click the Browse button .
d On the left, under Project, click Folders, and then double-click the MaizePredictionModeling folder.
e Double-click the BaselineBioclimateVariables folder.
f Click [Link], press Shift on your keyboard, and then click [Link].
g Click OK.
You have added all 19 baseline bioclimate variables.
Next, you will add the bioclimate variables for 2055.
h In the Geoprocessing pane, scroll to the bottom of the Input Rasters list.
i In the empty row, click the Browse button, as indicated in the following graphic.
j In the Input Rasters dialog box, go to the BioclimateProjectionVariables2055 folder.
- Hint
Click Folders, double-click MaizePredictionModeling, and then double-click BioclimateProjectionVariables2055.
k Click BioclimateProjections01_2055.crf.
l Press Shift on your keyboard and click BioclimateProjections19_2055.crf
m Click OK.
All the baseline and projected bioclimate variables are added to the geoprocessing pane. By adding all the bioclimate variables to the
prediction points, you have a complete prediction points layer to model future maize suitability using the Presence-only Prediction
(MaxEnt) tool.
Note: Running the Extract Multi Values To Points tool can take a few minutes, depending on your
computer's processing power.
n Click Run.
The PredictionPoints layer now contains all the necessary bioclimate variables and is ready for your prediction model.
o Turn off the GFSAD_Maize_Clip layer and save your project.
Collapse
- Step 3: Train the prediction model
Before performing the prediction, the model must be trained using the baseline variables.
The second step is to train the model using baseline bioclimate variables.
In this step, you will train the model using the training dataset, which includes the maize presence points with the baseline bioclimate
variables.
a In the Geoprocessing pane, search for and open the Presence-only Prediction (MaxEnt) (Spatial Statistics Tools) tool.
The input point features are the known areas of maize presence in the training dataset that you created for the study area. Because you
already prepared your data by reclassifying values to identify where maize is present, you can enable an option to indicate that the
training point dataset contains background points.
b For Input Point Features, choose PresencePoints.
c Check the box for Contains Background Points.
d For Presence Indicator Field, choose MaizePresent.
Step 3d: Train the prediction model.
To train the model, you will use the 19 baseline bioclimate variables as the explanatory training variables.
e Under Explanatory Training Variables, click the Add Many button .
f Check the box for each of the 19 BaselineBioclimate variables listed and click Add.
Step 3f: Train the prediction model.
You have added the baseline bioclimate variables to train the model.
You will now set the explanatory variable expansions and spatial thinning parameters.
The Explanatory Variable Expansions parameter specifies the basis function to be used to transform the explanatory variables for the
model. Basis functions incorporate more intricate relationship forms into the model. If multiple basis functions are selected, the tool will
run through all of them and use the variable that creates the best prediction.
Spatial thinning reduces sampling bias in your model when points are clustered. Highly clustered points can cause sampling bias by
artificially inflating model accuracy scores.
g Under Explanatory Variable Expansions (Basis Functions), ensure that Original (Linear) is checked, and then check the box for the
following additional options:
· Squared (Quadratic)
· Pairwise Interaction (Product)
· Smoothed Step (Hinge)
h For Apply Spatial Thinning, check the box.
i For Minimum Nearest Neighbor Distance, in the first field, type 5.
j In the second field, click the down arrow and choose Kilometers.
Step 3j: Train the prediction model.
k Expand Advanced Model Options.
The Relative Weight Of Presence To Background parameter should be a value between 1 and 100, with 100 being the default. A higher
value indicates that presence points are the primary source of information for training the model. A lower value indicates that
background points also contribute valuable information. The proportion of background points to presence points can significantly affect
prediction results. Creating a prediction model is an iterative process that requires you to adjust parameters, such as the proportion of
background points to presence points, until you have a model that is suitable for your research.
l For Relative Weight Of Presence To Background, leave the default value of 100.
Step 3l: Train the prediction model.
The Training Outputs section allow you to create outputs that can be used to review the diagnostics and reliability of the prediction
model. You will want to review these diagnostics, so you will name the training outputs now.
m Expand Training Outputs and set the following parameters:
· For Output Trained Features, type TrainedFeatures.
· For Output Response Curve Table, type CurveTable.
· For Output Sensitivity Table, type SensitivityTable.
Step 3m: Train the prediction model.
n Expand Prediction Options.
The Prediction Options section allows you to create the output layers that show the baseline and future suitability for maize based on
your trained model. The output prediction feature is a point feature layer that will be added to the map after the tool runs and will show
baseline maize suitability because you are using the baseline bioclimate variables as the explanatory variables.
o For Input Prediction Features, choose PredictionPoints.
p For Output Prediction Features, type BaselineMaizeSuitability.
q Under Match Explanatory Variables, confirm that the Baseline Bioclimate Prediction and Training variables match.
Step 3q: Train the prediction model.
Note: Training the model typically takes about 7 minutes but can take up to 20 minutes, depending
on your computer's processing power. If you do NOT want to train the model, read
through the next exercise step, Run the prediction model, and follow the instructions
to add the results to your project.
r If you are training the model, click the Pause Drawing button now.
s Click Run.
t After the model finishes running, in the Contents pane, turn off the BaselineMaizeSuitability layer.
The model has run successfully, but there is a warning. In the Geoprocessing pane, you can click the View Details option to opens the
tool's Message window. The Message window provides information about the warning and includes the diagnostic tables for the model.
Reviewing your model's diagnostics gives you a better idea of how your prediction model is performing and how you might fine tune it.
For more information on model diagnostics for the Presence-only Prediction (MaxEnt) tool, see ArcGIS Pro Help: How Presence-only
Prediction (MaxEnt) works.
u Click the Pause Drawing button to resume the map display.
You have trained your prediction model using the baseline bioclimate variables.
v Save your project.
Collapse
- Step 4: Run the prediction model
After the prediction model has been trained, the tool is rerun using the projected explanatory variables to create a prediction output.
The third step is to run the prediction model.
In this step, you will rerun the model using the projected bioclimate variables from the SSP3 7.0 climate scenario for 2055. The
prediction output will model maize suitability for the mid-century period of 2041 to 2070.
a In the Prediction Options section, for Output Prediction Features, delete BaselineMaizeSuitability and type FutureMaizeSuitability.
You will update the prediction explanatory variable to use the 2055 bioclimate projection variables.
b For Match Explanatory Variables, under Prediction, click the down arrow for BaselineBioclimate01.
c Scroll down the list of variables to find and select BioclimateProjections01_2055.
Step 4c: Run the prediction model.
You will complete this step for all 19 variables to match the prediction variables with the baseline variables that you used to train the
prediction model.
d Under Prediction, click the down arrow for BaselineBioclimate02 and select BioclimateProjections02_2055.
Step 4d: Run the prediction model.
e In a similar fashion, change the Prediction variable for the remaining bioclimate projection variables for 2055.
Step 4e: Run the prediction model.
All the variables for 2055 that you will use to predict future maize suitability are matched with the baseline bioclimate variables that were
used to train the model. You are ready to run to tool.
Note: Running the model typically takes about 7 minutes but can take up to 20 minutes, depending
on your computer's processing power. If you decided NOT to train the model in the
previous step and will NOT run the prediction model in this step, follow these
instructions to add the results to your map:
· In the Catalog pane, expand Databases.
· Expand [Link].
· Right-click FutureMaizeSuitability_Raster and choose Add To Current Map.
· Right-click BaselineMaizeSuitability_Raster and choose Add To Current Map.
f If you are running the model, click the Pause Drawing button now, and then click Run.
g After the model finishes running, in the Contents pane, turn off the FutureMaizeSuitability layer.
h Click the Pause Drawing button to resume the map display.
You have created a prediction output for future maize suitability that can help agricultural ministers plan for future climate change and
safeguard farmers and food security.
i Save your project.
Collapse
- Step 5: Review model diagnostics
When you run a model using the Presence-Only Prediction (MaxEnt) tool, a series of charts and tables are generated that display the
performance diagnostics of your model. It is important to review these performance diagnostics to get a sense of how accurately your
model is able to predict.
The fourth step is to review model diagnostics.
In this step, you will access two of these charts to review the performance diagnostics of your model.
Note: If you chose NOT to run the model, read through the following steps and use the
graphics provided for Partial Response Of Continuous Variables and Classification
Result Percentages to examine your model's performance diagnostics.
a At the bottom of the Contents pane, under Standalone Tables, open Partial Response Of Continuous Variables.
Note: Your chart may look slightly different due to the randomness of the points generated.
The Partial Response Of Continuous Variables chart summarizes and visualizes the impact of each bioclimate variable on the
probability of presence of maize. You can click individual charts to explore the effects of specific bioclimate variables in more detail.
Individual charts show the suitable ranges for each bioclimate variable, and, when considered together, suitable areas will be where
multiple bioclimate variables overlap to produce overall suitable conditions for the presence of maize.
b In the CurveTable, click BaselineBioclimate07 in the second row, fourth column.
Step 5b: Review model diagnostics.
The baseline bioclimate variable 07 represents annual temperature range. The presence probability of maize will be low if the annual
temperature range is too cold or too hot. The presence probability of maize increases quickly from 0°C to approximately 15°C, slowly
declines from approximately 15°C to 25°C, and then declines rapidly as annual mean temperatures increase above 25°C to 30°C.
These charts are helpful for identifying suitable and unsuitable bioclimates for maize based on a single variable.
You will now review a second chart.
c In the Contents pane, under TrainedFeatures, double-click Classification Result Percentages (Cutoff = 0.5) to open the chart.
The Classification Result Percentages chart compares the observed and predicted classifications. You can use this chart as a training
assessment to check how your prediction model performs when recognizing presence. The prediction model's accuracy is measured as
the percentage of presence points that were correctly classified by the model.
d Point to the Presence - Correctly Classified classification portion of the bar chart, shown in blue, and use the pop-up to answer the
following question.
? What percentage of the presence points was correctly classified?
(Hint: Click the following View Result link to view the pop-up, if necessary.)
Step 5d: Review model diagnostics.
You may get a slightly different percentage result due to the random points the model uses.
- Answer
Approximately 72 percent of known presence locations were correctly classified by the
model. You may see a slightly different percentage because the model uses random
points.
For this purposes of this exercise, 70 percent or so is a reasonable performance number for the model. Creating predictions models is
an iterative process; you can change the parameters of the model based on the model's diagnostics or add new data sources to help
enhance the performance of your model. How accurate you need your model to be will depend on the spatial analysis question that you
are trying to answer.
e Now point to the Background - Unchanged classification of the bar chart, shown in gray.
(Hint: Click the following View Result link to view the pop-up, if necessary.)
Step 5e: Review model diagnostics.
The percentage that you see may vary slightly.
The Background - Unchanged classification of the bar chart confirms that a lack of presence was observed and that, according to the
prediction model, no presence should be observed in those areas. If the Background - Unchanged (gray) classification and the
Presence - Correctly Classified (blue) classification are the largest portions of your chart, then your prediction model is performing well.
f Close both charts and save your project.
In this step, you used two charts to review the performance diagnostics of your model
Collapse
- Step 6: Convert point features to raster
Reviewing the performance diagnostics for a model allows you to confirm that the model is performing as intended and that the results
are valid for use. After reviewing the performance diagnostics for your maize suitability model, you have decided that the results are
valid.
Because the baseline and future maize suitability layers are both point feature layers containing 5.2 million points, you want to convert
them to raster layers, a format that will be easier to visualize and share. In this step, you will use the Point To Raster tool to convert both
of the presence-only prediction output layers from point feature layers to rasters.
a In the Geoprocessing pane, search for and open the Point To Raster (Conversion Tools) tool.
Note: If you chose NOT to run the model and instead added the results to your map, read
through the instructions in this step but do NOT run the Point To Raster tool; you
already have the final raster layers that you need to compare the results in the next
step.
b Set or confirm the following parameters:
· Input Features: BaselineMaizeSuitability
· Value Field: Probability Of Presence
· Output Raster Dataset: BaselineMaizeSuitability_Raster
· Cell Assignment Type: Sum
· Priority Field: NONE
c For Cellsize, click the Browse button .
d Under Project, double-click Folders.
e Double-click the MaizePredictionModeling folder and then the GFSAD folder.
f Select [Link] and click OK.
Step 6f: Convert point features to raster.
Value Field indicates which field in the attribute table will be used to assign values to the output raster layer. Probability Of Presence
classifies the probability of the presence of maize for each cell in the layer. Cell Assignment Type lets you choose the best method of
determining how the cell value is assigned when more than one feature falls within the cell. For Cellsize, you used the GFSAD layer to
indicate that the cell size for the new raster is 1 square kilometer.
Note: It may take a minute for the tool to run because of the number of points.
g Click Run.
You will now convert the FutureMaizeSuitability layer.
h In the Geoprocessing pane, for Input Features, click the down arrow and choose FutureMaizeSuitability.
i For Output Raster Dataset, replace BaselineMaizeSuitability_Raster with FutureMaizeSuitability_Raster.
Step 6i: Convert point features to raster.
It is important to leave all the other parameters the same because you are comparing the baseline and future layers.
j Click Run.
k After the tool finishes running, in the Contents pane, turn off the TrainedFeatures layer.
l Save your project.
You have converted the baseline and future maize suitability layers from point feature layers to raster layers to facilitate visualizing and
sharing the results with the agricultural ministers in Africa.
Collapse
- Step 7: Compare the results
The final step in this iterative workflow is to review the results of your prediction model.
The final step is to review the model results.
The goal of using a presence-only prediction model is to compare the change between baseline and projected suitability. However,
when you converted your prediction output layers from point feature to raster layers in the previous step, the layers were added to your
map using symbology that is difficult to interpret.
In this step, you will update the color scheme of the symbology to make it easier to compare the results and visualize the change in
maize suitability in Africa. In preparation, you will first organize the layers in the Contents pane.
a In the Contents pane, click and drag the FutureMaizeSuitability_Raster layer to the top of the drawing order.
b Click and drag the BaselineMaizeSuitability_Raster layer above the FutureMaizeSuitability_Raster layer.
Step 7b: Compare the results.
c Right-click the BaselineMaizeSuitability_Raster layer and choose Symbology.
d In the Symbology pane, for Color Scheme, click the down arrow.
e Check Show Names, and then scroll down to select the Yellow-Green (Continuous) color scheme.
f For Stretch Type, choose Minimum Maximum.
g If necessary, zoom to the BaselineMaizeSuitability_Raster layer.
Step 7g: Compare the results.
The yellow areas on the map represent the baseline, or current, areas that are not suitable for growing maize. The green areas
represent the areas that are suitable for growing maize, with the darkest green areas being the most suitable.
To compare the baseline results with the future results, you will use the same symbology settings for the FutureMaizeSuitability_Raster
layer.
h Open the Symbology pane for the FutureMaizeSuitability_Raster layer.
i At the top right of the Symbology pane, click the Pane Display Options button and choose Import From Layer.
The Apply Symbology From Layer tool displays.
j Set or confirm the following parameters:
· Input Layer: FutureMaizeSuitability_Raster
· Symbology Layer: BaselineMaizeSuitability_Raster
k Click Run.
With both the baseline and future suitability layers symbolized using the same color scheme, you can now use the Swipe tool to visually
compare change in suitable maize locations in Africa.
First, you will change the basemap to one that contrasts more with the symbology colors.
l On the ribbon, from the Map tab, in the Layer group, click Basemap and choose Imagery.
Now you will activate the Swipe tool.
m In the Contents pane, select the BaselineMaizeSuitability_Raster layer.
n On the ribbon, click the Raster Layer tab and, in the Compare group, click Swipe.
o Click anywhere on the right side of the map, and then drag your mouse from right to left to see the changes.
Step 7o: Compare the results.
Comparing the baseline and future results shows that, for the SSP3 7.0 climate scenario, suitable land area for maize will shrink
significantly by the mid-century period of 2041 to 2070. The loss of even small areas of crop land can put the food security of a country
at risk. Prediction modeling allows forecasting and planning for such changes to minimize the impact of climate change, especially for
vulnerable populations that depend on smallholder agriculture as their main source of income.
p Save your project.
You have explored the results of your prediction model by comparing baseline and future suitability for growing maize in Africa.
q Exit ArcGIS Pro.
In this exercise, you trained a prediction model using baseline bioclimate variables to identify current maize suitability in Africa. Then,
you used your trained model to create a prediction model for future maize suitability based on the SSP3 7.0 climate scenario for the
mid-century period of 2041 to 2070 and compared the results.
Collapse
Copyright © Esri
All rights reserved.
Published in the United States of America.
The information contained in this document is the exclusive property of Esri. This work is protected under United States copyright law and other
international copyright treaties and conventions. No part of this work may be reproduced or transmitted in any form or by any means, electronic
or mechanical, including photocopying and recording, or by any information storage or retrieval system, except as expressly permitted in writing
by Esri. All requests should be sent to Attention: Director, Contracts and Legal, Esri, 380 New York Street, Redlands, CA 92373-8100, USA.
Export Notice: Use of these Materials is subject to U.S. export control laws and regulations including the U.S. Department of Commerce
Export Administration Regulations (EAR). Diversion of these Materials contrary to U.S. law is prohibited.
The information contained in this document is subject to change without notice.
Commercial Training Course Agreement Terms: The Training Course and any software, documentation, course materials or data
delivered with the Training Course is subject to the terms of the Master Agreement for Products and Services found at the following website:
[Link]/TrainingTerms. The license rights in the Master Agreement strictly govern Licensee's use, reproduction, or disclosure of the
software, documentation, course materials and data. Training Course students may use the course materials for their personal use and may
not copy or redistribute for any purpose. Contractor/Manufacturer is Esri, 380 New York Street, Redlands, CA 92373-8100, USA.
Esri Marks: Esri marks and product names mentioned herein are subject to the terms of use found at the following website:
[Link]/EsriMarks.
Other companies and products or services mentioned herein may be trademarks, service marks, or registered marks of their respective mark
owners.