CrossValidationResult (arcpy)

摘要

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.

讨论

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

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.

属性

属性说明数据类型
averageStandard
(只读)

The average of the prediction standard errors.

Double
count
(只读)

The number of input samples.

Long
inputCount
(只读)

Returns the number of inputs.

Integer
maxSeverity
(只读)

Returns the maximum severity of the messages.

  • 0If the tool produced only informative messages.
  • 1 If the tool produced a warning message, but no error messages.
  • 2 If the tool produced an error message.
Integer
meanError
(只读)

The averaged difference between the measured and the predicted values.

Double
meanStandardized
(只读)

Mean standardized error.

Double
messageCount
(只读)

Returns the number of messages.

Integer
outputCount
(只读)

Returns the number of outputs.

Integer
resultID
(只读)

Gets the job ID. If the tool is not a geoprocessing service, the resultID will be "".

String
rootMeanSquare
(只读)

The root mean square error.

Double
rootMeanSquareStandardized
(只读)

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
(只读)

Gets the job status.

  • 0New
  • 1Submitted
  • 2Waiting
  • 3Executing
  • 4Succeeded
  • 5Failed
  • 6Timed out
  • 7Cancelling
  • 8Cancelled
  • 9Deleting
  • 10Deleted
Integer

方法概述

方法说明
cancel ()

Cancels an associated job

getInput (index)

Returns a given input, either as a recordset or string.

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

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

getMessage (index)

Returns a specific message.

getMessages ({severity})

Returns messages.

getOutput (index)

以记录集或者字符串形式返回给定的输出。

如果工具(如 MakeFeatureLayer)的输出是一个图层,则 getOutput 将返回 Layer 对象。

getSeverity (index)

Returns the severity of a specific message.

方法

cancel ()
getInput (index)
参数说明数据类型
index

The index position of the input.

Integer
返回值
数据类型说明
Object

The input, either as a recordset or string.

getMapImageURL ({parameter_list}, {height}, {width}, {resolution})
参数说明数据类型
parameter_list

Parameter(s) on which the map service image will be based.

Integer
height

The height of the image.

Double
width

The width of the image.

Double
resolution

The resolution of the image.

Double
返回值
数据类型说明
String

The URL of the map image.

getMessage (index)
参数说明数据类型
index

The index position of the message.

Integer
返回值
数据类型说明
String

The geoprocessing message.

getMessages ({severity})
参数说明数据类型
severity

The type of messages to be returned: 0=message, 1=warning, 2=error. Not specifying a value returns all message types.

  • 0informational message
  • 1warning message
  • 2error message

(默认值为 0)

Integer
返回值
数据类型说明
String

The geoprocessing messages.

getOutput (index)
参数说明数据类型
index

The index position of the outputs.

Integer
返回值
数据类型说明
Object

输出为记录集或者字符串形式。

如果工具(如 MakeFeatureLayer)的输出是一个图层,则 getOutput 将返回 Layer 对象。

还可按索引访问结果输出,因此 result.getOutput(0)result[0] 是等效的。

getSeverity (index)
参数说明数据类型
index

The message index position.

Integer
返回值
数据类型说明
Integer

The severity of the specific message.

  • 0informational message
  • 1warning message
  • 2error message

代码实例

CrossValidation (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 (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)
5/10/2014