Cross Validation (Geostatisical Analyst)
Summary
Removes one data location then predicts the associated data using the data at the rest of the locations. The primary use for this tool is to compare the predicted value to the observed value in order to obtain useful information about some of your model parameters.
Usage
When using this tool in Python, the result object contains both a feature class and a CrossValidationResult, which has the following properties:
- Count—Total number of samples used.
- Mean Error—The averaged difference between the measured and the predicted values.
- Root Mean Square Error—Indicates how closely your model predicts the measured values. The smaller this error, the better.
- Average Standard Error—The average of the prediction standard errors.
- Mean Standardized Error— The mean of the standardized errors. This value should be close to 0.
- Root Mean Square Standardized Error—This should be close to one if the prediction standard errors are valid. If the root-mean-squared standardized error is greater than one, you are underestimating the variability in your predictions. If the root mean square standardized error is less than one, you are overestimating the variability in your predictions.
The fields in the optional output feature class are described in GA Layer To Points tool.
Syntax
CrossValidation_ga (in_geostat_layer, {out_point_feature_class})
Parameter | Explanation | Data Type |
in_geostat_layer |
The geostatistical layer to be analyzed. | Geostatistical Layer |
out_point_feature_class (Optional) |
Stores the cross-validation statistics at each location in the geostatistical layer. | Feature Class |
Code Sample
CrossValidation example 1 (Python window)
Perform cross validation on an input geostatistical layer.
import arcpy
arcpy.env.workspace = "C:/gapyexamples/data"
cvResult = arcpy.CrossValidation_ga("C:/gapyexamples/data/kriging.lyr")
print "Root Mean Square error = " + str(cvResult.rootMeanSquare)
CrossValidation example 2 (stand-alone script)
Perform cross validation on an input geostatistical layer.
# Name: CrossValidation_Example_02.py
# Description: Perform cross validation on an input geostatistical layer.
# Requirements: Geostatistical Analyst Extension
# Import system modules
import arcpy
# Set environment settings
arcpy.env.workspace = "C:/gapyexamples/data"
# Set local variables
inLayer = "C:/gapyexamples/data/kriging.lyr"
# Check out the ArcGIS Geostatistical Analyst extension license
arcpy.CheckOutExtension("GeoStats")
# Execute CrossValidation
cvResult = arcpy.CrossValidation_ga(inLayer)
print "Root Mean Square error = " + str(cvResult.rootMeanSquare)
Environments
Related Topics
Licensing Information
ArcGIS for Desktop Basic: Requires Geostatistical Analyst
ArcGIS for Desktop Standard: Requires Geostatistical Analyst
ArcGIS for Desktop Advanced: Requires Geostatistical Analyst
6/24/2013