Predict Using Regression Model

URL:
https://<rasteranalysistools-url>/PredictUsingRegressionModel
Methods:
GET
Version Introduced:
10.9.1

Description

PredictUsingRegressionModelRest diagram

The PredictUsingRegressionModel task predicts data values using the output from the TrainRandomTreesRegressionModel tool.

Request parameters

ParameterDetails

inputRasters

(Required)

A raster or a list of input rasters. The input rasters can be the Portal Item ID, Image Service URL, cloud multidimensional raster dataset or shared raster dataset. The rasters can be single-band, multidimensional, multiband raster datasets, or mosaic datasets, containing explanatory variables

The input rasters must be in the same form as when the regression model was trained. For example, the input must contain the same number of items in the list, in the same order, and each item must match (including the variables of a multidimensional raster).

At least one type of input needs to be provided in the JSON object. If multiple inputs are given, the itemIds takes the priority

Syntax: A JSON object describing the input raster(s).

Example of single item.

Use dark colors for code blocksCopy
1
2
3
inputRasters={"itemId": <portal item id>}
inputRasters={"url": <image service url>}
inputRasters={"uri": <cloud raster uri or shared data path>}

Example of a list of items.

Use dark colors for code blocksCopy
1
2
3
InputRasters={"itemIds": [<portal item id>, <portal item id>, <portal item id>]}
InputRasters={"urls": [<image service url>, <image service url>, <image service url>]}
InputRasters={"uris": [<cloud raster uri or shared data path>, <cloud raster uri or shared data path>]}

inputRegressionDefinition

(Required)

Parameter used to specify the regression definition. It is the JSON that contains attribute information, statistics, or other information from the regression model. The JSON is the output of the Train Random Trees Regression Model tool. The parameter can also be specified as the datastore path to this JSON.

Syntax: A JSON describing the regression model.

Example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
InputRegressionDefinition=
 {
   "EsriClassifierDefinitionFile":0,
   "FileVersion":3,
   "NumberDefinitions":1,
   "Definitions": [
      {
         "Classifier":"RandomTrees",
         "NumberClasses":0,
         "RasterIsSegmented": false,
         "NumberBands":6,
  }

Syntax: A JSON with uri key and value representing the datastore path.

Use dark colors for code blocksCopy
1
2
InputRegressionDefinition=
{"uri": "/fileShares/my_fileshare/input_regression_model.ecd"}

outputPredictedRasterName

(Required)

A raster of the predicted values. The input can be the Portal Item ID, Image Service URL or service properties of the raster.

Syntax: A JSON object that describes the outputPredictedRaster.

Example

Use dark colors for code blocksCopy
1
2
3
4
5
outputPredictedRasterName={"itemId": <portal item id>}
outputPredictedRasterName={"url": <image service url >}
outputPredictedRasterName={"uri": <cloud raster uri or shared data path >}

outputPredictedRasterName={"serviceProperties": {"name": "PredictedRaster", "capabilities": "image, metadata"}}

context

Contains additional settings that affect task execution. This task has the following settings:

  • Cell Size (cellSize)—The output raster will have the resolution specified by cell size.

  • Extent (extent)—A bounding box that defines the analysis area.

  • Output Spatial Reference (outSR)—The output raster will be projected into the output spatial reference.

  • Processor Type(processorType )—Processing will occur using the server computer CPU or GPU.

  • Snap Raster (snapRaster)—The output raster will have its cells aligned with the specified snap raster.

  • Cell Alignment (cellAlignment )—This will adjust the cell alignment of the output to match the cell alignment of the specified processing extent.

    • DEFAULT —The cell alignment will follow the default behavior of the tool. This is the default.
    • ALIGN_WITH_INPUT —The output cells will follow the alignment of the input.
    • ALIGN_WITH_PROCESSING_EXTENT —The extent of the output cells will be adjusted to match the cell alignment of the specified processing extent.
  • Resampling Method (resamplingMethod )—Specifies the resampling method that will be used when creating the raster dataset for download.

    • NEAREST—The value of the closest cell will be used to assign a value to the output cell when resampling. This is the default.
    • BILINEAR—The new value of a cell will be based on a weighted distance average of the four nearest input cell centers.
    • CUBIC—The new value of a cell will be based on fitting a smooth curve through the 16 nearest input cell centers.
  • Parallel Processing Factor (parallelProcessingFactor )—The specified number or percentage of processes will be used for the analysis.

f

The response format. The default response format is html.

Values: html | json

Response

When you submit a request, the task assigns a unique job ID for the transaction.

Syntax:

Use dark colors for code blocksCopy
1
{ "jobId": "<unique job identifier>", "jobStatus": "<job status>" }

After the initial request is submitted, you can use the jobId to periodically check the status of the job and messages, as described in Check job status. Once the job has successfully completed, use the jobId to retrieve the results. To track the status, you can make a request of the following form:

Use dark colors for code blocksCopy
1
http://<analysis url>/PredictUsingRegressionModel/jobs/<jobId>

When the status of the job request is esriJobSucceeded , you can access the results of the analysis by making a request of the following form:

Use dark colors for code blocksCopy
1
2
3
http://<raster analysis url>/
PredictUsingRegressionModel/jobs/<jobId>/results/outputPredictedRaster
?token=<your token>&f=json

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.