本文簡要介紹 python 語言中 arcgis.raster.analytics.train_random_trees_regression_model
的用法。
用法:
arcgis.raster.analytics.train_random_trees_regression_model(input_rasters, input_target_data, target_value_field=None, target_dimension_field=None, raster_dimension=None, max_number_of_trees=50, max_tree_depth=30, max_number_of_samples=100000, average_points_per_cell='KEEP_ALL_POINTS', output_scatter_plots_name=None, output_sample_features_name=None, percent_samples_for_testing=10, output_importance_table_name=None, context=None, *, gis=None, future=False, **kwargs)
返回:
字典
對解釋變量(自變量)和目標數據集(因變量)之間的關係進行建模。該函數在 ArcGIS Image Server 10.9.1 及更高版本中可用(在 ArcGIS Online 中不可用)。
Parameter
Description
input_rasters
必需的
ImageryLayer
對象。包含解釋變量的單波段、多維或多波段柵格或鑲嵌數據集。input_target_data
必需的
FeatureLayer
或ImageryLayer
對象。包含目標變量(因變量)數據的柵格或要素圖層。target_value_field
可選字符串。要在目標要素圖層或柵格中建模的信息的字段名稱。
target_dimension_field
可選字符串。輸入要素圖層中定義維度值的日期字段或數字字段。
raster_dimension
可選字符串。鏈接到目標數據中維度的輸入多維柵格(解釋變量)的維度名稱。
max_number_of_trees
可選整數。森林中的最大樹數。增加樹的數量將導致更高的準確率,盡管這種改進會趨於平穩。樹的數量線性增加了處理時間。默認值為 50。
max_tree_depth
可選整數。森林中每棵樹的最大深度。深度決定了每棵樹可以創建的規則數量,從而產生決策。樹不會比此設置更深。默認值為 30。
max_number_of_samples
可選整數。將用於回歸分析的最大樣本數。小於或等於 0 的值表示係統將使用輸入目標柵格或要素圖層中的所有樣本來訓練回歸模型。默認值為 100,000。
average_points_per_cell
可選字符串。指定當多個訓練點落入一個單元格時是否計算平均值。此參數僅在輸入目標為要素圖層時適用。選項包括:
KEEP_ALL_POINTS — 當多個訓練點落入單個單元格時,將使用所有點。這是默認設置。
AVERAGE_POINTS_PER_CELL —將計算單元內訓練點的平均值。
output_scatter_plots_name
可選字符串。輸出散點圖的名稱包括訓練數據、測試數據和位置測試數據的散點圖。
output_sample_features_name
可選字符串。包含訓練點、測試點和位置測試點的目標值和預測值的輸出要素類的名稱。
percent_samples_for_testing
可選浮點數。定義用於錯誤檢查的測試點的百分比。該工具檢查三種類型的錯誤:訓練點錯誤、測試點錯誤和測試位置點錯誤。默認值為 10。
output_importance_table_name
可選字符串。要創建的輸出特征項或表項的名稱。此名稱是為了創建一個包含說明模型中使用的每個解釋變量的重要性的信息的表。數字越大,表示對應變量與預測變量的相關性越高,對預測的貢獻越大。值介於 0 和 1 之間,所有值之和等於 1。
context
上下文包含影響任務執行的其他設置。
context 參數覆蓋通過arcgis.env 參數設置的值
此函數具有以下設置:
像元大小 (cellSize) - 設置輸出柵格像元大小或分辨率
Extent(範圍):定義分析區域的邊界框。
例子:
{“extent”: {“xmin”: -122.68,“ymin”: 45.53,“xmax”: -122.45,“ymax”: 45.6,“spatialReference”: {“wkid”: 4326}}}並行處理因子(parallelProcessingFactor):控製光柵處理(CPU)服務實例。
例子:
具有指定數量的處理實例的語法示例:
{“parallelProcessingFactor”: “2”}
具有指定百分比的總處理實例的語法示例:
{“parallelProcessingFactor”: “60%”}
gis
可選的地理信息係統。運行此工具的
GIS
。如果未指定,則使用活動 GIS。future
僅關鍵字參數。可選布爾值。如果為 True,則結果將是一個 GPJob 對象,並且結果將異步返回。
folder
僅關鍵字參數。可選的 str 或 dict。使用給定的文件夾名稱在門戶中創建一個文件夾(如果不存在),並將輸出保留在此文件夾中。
create_folder()
返回的字典也可以作為輸入傳入。例子:
{‘username’: ‘user1’,‘id’: ‘6a3b77c187514ef7873ba73338cf1af8’,‘title’: ‘trial’}例子:
# Usage Example 1: my_raster_1 = gis.content.search("raster_1", item_type="Imagery Layer")[0].layers[0] my_raster_2 = gis.content.search("raster_2", item_type="Imagery Layer")[0].layers[0] input_rasters = [my_raster_1, my_raster_2] input_target_data = gis.content.search("my_target_data")[0].layers[0] train_random_trees_regression_model_op = train_random_trees_regression_model(input_rasters=input_rasters, input_target_data=input_target_data, gis=gis)
相關用法
- Python ArcGIS train_classifier用法及代碼示例
- Python arcgis.learn.train_model用法及代碼示例
- Python ArcGIS trace_downstream用法及代碼示例
- Python ArcGIS trim_extend用法及代碼示例
- Python ArcGIS tanh用法及代碼示例
- Python ArcGIS to_geo_coordinate_string用法及代碼示例
- Python ArcGIS tan用法及代碼示例
- Python ArcGIS threshold用法及代碼示例
- Python ArcGIS times用法及代碼示例
- Python ArcGIS power用法及代碼示例
- Python ArcGIS APIKeyManager.get用法及代碼示例
- Python ArcGIS KnowledgeGraph.named_object_type_delete用法及代碼示例
- Python ArcGIS ContentManager.unshare_items用法及代碼示例
- Python ArcGIS ImageryLayer.thumbnail用法及代碼示例
- Python ArcGIS FormFieldElement用法及代碼示例
- Python ArcGIS Geometry.true_centroid用法及代碼示例
- Python ArcGIS Site.delete用法及代碼示例
- Python ArcGIS GeoAccessor.bbox用法及代碼示例
- Python arcgis.apps.hub.Initiative.update用法及代碼示例
- Python ArcGIS generate_service_areas用法及代碼示例
- Python ArcGIS build_overview用法及代碼示例
- Python ArcGIS RunInterval用法及代碼示例
- Python ArcGIS describe_dataset用法及代碼示例
- Python ArcGIS acos用法及代碼示例
- Python ArcGIS Item.publish用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 arcgis.raster.analytics.train_random_trees_regression_model。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。