Skip to main content

CrossValidationResult

Résumé

The CrossValidationResult class is returned by the Cross Validation tool and contains access to the cross-validation results that can be generated for any geostatistical layer.

Discussion

The CrossValidationResult class is similar to the Result class except for the additional read-only properties that it contains. For detailed help, see the Cross Validation tool.

Only the mean and root mean square error results are available for IDW, Global Polynomial Interpolation, Radial Basis Functions, Diffusion Interpolation With Barriers, and Kernel Interpolation With Barriers.

Percent in 90% Interval, Percent in 95% Interval, and Average CRPS are only available for Empirical Bayesian Kriging and EBK Regression Prediction models.

Propriétés

Nom Explication Type de données

averageCRPS

(Lecture seule)

The average of the Continuous Ranked Probability Scores (CRPS) for all points.

Double

averageStandard

(Lecture seule)

The average of the prediction standard errors.

Double

count

(Lecture seule)

The number of input samples.

Long

inputCount

(Lecture seule)

The number of inputs.

Integer

maxSeverity

(Lecture seule)

Specifies the maximum severity of the messages.

  • 0—The tool produced only informative messages.

  • 1—The tool produced a warning message but no error messages.

  • 2—The tool produced an error message.

Integer

meanError

(Lecture seule)

The averaged difference between the measured and the predicted values.

Double

meanStandardized

(Lecture seule)

Mean standardized error.

Double

messageCount

(Lecture seule)

The number of messages.

Integer

outputCount

(Lecture seule)

The number of outputs.

Integer

percentIn90Interval

(Lecture seule)

The percentage of points that are contained in a 90 percent cross validated confidence interval.

Double

percentIn95Interval

(Lecture seule)

The percentage of points that are contained in a 95 percent cross validated confidence interval.

Double

resultID

(Lecture seule)

The job ID. If the tool is not a geoprocessing service, the value will be "".

String

rootMeanSquare

(Lecture seule)

The root mean square error.

Double

rootMeanSquareStandardized

(Lecture seule)

The root-mean-square-standardized error should be close to 1 if the prediction standard errors are valid. If the root-mean-square-standardized error is greater than 1, you are underestimating the variability in your predictions. If the root-mean-square-standardized error is less than 1, you are overestimating the variability in your predictions.

Double

status

(Lecture seule)

Specifies the job status.

  • 0—The job status is New.

  • 1—The job status is Submitted.

  • 2—The job status is Waiting.

  • 3—The job status is Executing.

  • 4—The job status is Succeeded.

  • 5—The job status is Failed.

  • 6—The job status is Timed out.

  • 7—The job status is Cancelling.

  • 8—The job status is Cancelled.

  • 9—The job status is Deleting.

  • 10—The job status is Deleted.

Integer

Méthodes

cancel()

Cancel an associated job.

getInput(index)

Returns a given input, either as a string or a RecordSet object.

Nom Explication Type de données

index

The index position of the input as an integer, or the parameter name.

Variant

Valeur de retour

Type de données Explication

Variant

The input, either as a RecordSet object or a string.

getMapImageURL({parameter_list}, {height}, {width}, {resolution})

Returns a map service image for a given output, if one exists.

Nom Explication Type de données

parameter_list

(Facultatif)

The parameters on which the map service image will be based.

Integer

height

(Facultatif)

The height of the image.

Double

width

(Facultatif)

The width of the image.

Double

resolution

(Facultatif)

The resolution of the image.

Double

Valeur de retour

Type de données Explication

String

The URL of the map image.

getMessage(index)

Returns a specific message by index position.

Nom Explication Type de données

index

The index position of the message.

Integer

Valeur de retour

Type de données Explication

String

The geoprocessing message.

getMessages({severity})

Returns the geoprocessing tool messages.

Nom Explication Type de données

severity

(Facultatif)

The type of messages to be returned.

  • 0—Informative, warning, and error messages are returned.

  • 1—Only warning messages are returned.

  • 2—Only error messages are returned.

Not specifying a severity level will return all types of messages.

The default value is 0.

Integer

Valeur de retour

Type de données Explication

String

The geoprocessing tool messages.

getOutput(index)

Returns a given output, either as a RecordSet object or a string.

If the output of the tool, such as Make Feature Layer, is a layer, getOutput will return a Layer object.

Nom Explication Type de données

index

The index position of the output as an integer, or the parameter name.

Variant

Valeur de retour

Type de données Explication

Variant

The output, either as a RecordSet or a string.

If the output of the tool, such as Make Feature Layer, is a layer, getOutput will return a Layer object.

Result outputs can also be accessed by index by integer or by name. For example, to access the record count from the Get Count tool, result.getOutput(0), result[0], result.getOutput("row_count"), and result["row_count"] are equivalent.

getSeverity(index)

Specifies the severity of a specific message.

Nom Explication Type de données

index

The message index position.

Integer

Valeur de retour

Type de données Explication

Integer

The severity of the specific message.

  • 0—Informative, warning, and error messages are returned.

  • 1—Only warning messages are returned.

  • 2—Only error messages are returned.

Exemple de code

CrossValidation (Python window)

Perform cross-validation on an input geostatistical layer.

import arcpy
arcpy.env.workspace = "C:/gapyexamples/data"
cvResult = arcpy.ga.CrossValidation("C:/gapyexamples/data/kriging.lyr")
print("Root Mean Square error = " + str(cvResult.rootMeanSquare))
CrossValidation (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"

# Run CrossValidation
cvResult = arcpy.ga.CrossValidation(inLayer)
print("Root Mean Square error = " + str(cvResult.rootMeanSquare))