公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
媒体资源预测
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
使用 model.predictProperties()
对 ee.FeatureCollection
进行预测。每个地图项都是一个数据点,每个属性都是一个模型输入地图项。输入和输出可以是标量字符串值、标量布尔值,或任何形状(从标量到多维数组)的数值。模型的输出在输出表格中表示为新属性。
如需控制模型的输入和输出,请使用以下参数:
将输入属性设置为您明确要发送到托管模型的属性列表。
inputTypeOverride
是一个属性名称字典,其中包含提供的特定类型和维度信息。这可能很有必要,因为许多 Earth Engine 算法都会创建具有动态类型的输出,而这些类型在运行时之前无法推断出来。
例如,我们可以通过将 ee.Terrain.slope
函数映射到集合来计算值“slope”,我们可能需要在推理输入中指定“slope”的输出类型,如下所示:
inputTypeOverride = {
"slope": {
"type": "PixelType",
"precision": "float",
"dimensions": 0,
"min": -100.0,
"max": 100.0
}
}
提示:您可能会偶尔遇到“无法将属性转换为张量”的错误消息。可能的解决方案是使用类型替换强制将输入转换为给定类型。
outputProperties
从输出属性名称到输出属性信息字典的映射。有效的属性信息字段包括“type”和“dimensions”。“type”应为描述输出属性的 ee.PixelType
,而“dimensions”是可选整数,表示该属性(如果是数组)的维度数。例如,给定 1D 数组属性“p”,请指定以下输出属性:
outputProperties = {
"p": {
"type": ee.PixelType.int8(),
"dimensions": 1
}
}
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-10-01。
[null,null,["最后更新时间 (UTC):2024-10-01。"],[[["\u003cp\u003eUse \u003ccode\u003emodel.predictProperties()\u003c/code\u003e to generate predictions on an \u003ccode\u003eee.FeatureCollection\u003c/code\u003e where each Feature represents a data point and each property is a model input feature.\u003c/p\u003e\n"],["\u003cp\u003eControl model inputs and outputs with \u003ccode\u003einputProperties\u003c/code\u003e, \u003ccode\u003einputTypeOverride\u003c/code\u003e, and \u003ccode\u003eoutputProperties\u003c/code\u003e arguments within \u003ccode\u003emodel.predictProperties()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003einputTypeOverride\u003c/code\u003e helps define specific type and dimension information for properties, particularly those with dynamic types derived from Earth Engine algorithms.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eoutputProperties\u003c/code\u003e defines the type and dimensions of expected model outputs, including specifying array properties using \u003ccode\u003eee.PixelType\u003c/code\u003e and \u003ccode\u003edimensions\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Property Predictions\n\nUse `model.predictProperties()` to make predictions on an\n`ee.FeatureCollection`. Each Feature is a data point, and each property is a\nmodel input feature The inputs and outputs can be scalar string values,\nscalar boolean values, or numeric values of any shape, from scalars to\nmultidimensional arrays. The outputs of the model are represented as new\nproperties in the output table.\n\nInput and Outputs\n-----------------\n\nTo control the inputs and outputs of the model use the following arguments:\n\n### `inputProperties`\n\nSet input properties to the list of properties you explicitly want to send do\nyour hosted model.\n\n#### `inputTypeOverride`\n\n`inputTypeOverride` is a dictionary of property names with specific type and\ndimension information provided. This might be necessary because many Earth\nEngine algorithms create outputs with dynamic types that cannot be inferred\nuntil runtime.\n\nFor example we may compute a value \"slope\" by mapping the `ee.Terrain.slope`\nfunction over a collection we may need to specify the output type of \"slope\" in\nour inference inputs like so: \n\n inputTypeOverride = {\n \"slope\": {\n \"type\": \"PixelType\",\n \"precision\": \"float\",\n \"dimensions\": 0,\n \"min\": -100.0,\n \"max\": 100.0\n }\n }\n\nTIP: You may occasionally encounter the error message that a property \"cannot be\nconverted to a tensor\". The likely solution is to use a type override to force\nthe input to a given type.\n\n### `outputProperties`\n\nA map from output property names to a dictionary of output property info. Valid\nproperty info fields are 'type' and 'dimensions'. 'type' should be a\n`ee.PixelType` describing the output property, and 'dimensions' is an optional\ninteger with the number of dimensions for that property if it is an array. For\nexample, given an 1D array property \"p\" specify the following output\nproperty: \n\n outputProperties = {\n \"p\": {\n \"type\": ee.PixelType.int8(),\n \"dimensions\": 1\n }\n }"]]