Generalized Linear Regression

This tool performs Generalized Linear Regression (GLR) to generate predictions or to model a dependent variable's relationship to a set of explanatory variables. This tool can be used to fit continuous (Gaussian and OLS), binary (logistic), and count (Poisson) models.
The following are examples of the types of questions you can answer using this tool:
- What demographic characteristics contribute to high rates of public transportation usage?
- Is there a positive relationship between vandalism and burglary?
- Which variables effectively predict 911 call volume? Given future projections, what is the expected demand for emergency response resources?
- What variables affect low birth rates?
Note:Generalized Linear Regression was introduced in ArcGIS Enterprise 10.7.
Request URL
https://<analysis URL>/GeneralizedLinearRegression/submitJob
Request parameters
Parameter | Description |
|---|---|
inputLayer (Required) | The layer containing the dependent and independent variables. Syntax: As described in Feature input, this parameter can be one of the following:
REST web example:
REST scripting example:
|
featuresToPredict (Optional) | A layer containing features representing locations where estimates should be computed. Each feature in this dataset should contain values for all the explanatory variables specified. The dependent variable for these features will be estimated using the model calibrated for the input layer data. Syntax: As described in Feature input, this parameter can be one of the following:
|
dependentVariable (Required) | The numeric field containing the observed values you want to model. REST web example: Earnings REST scripting example: "dependentVariable": "Arrest" |
explanatoryVariables (Required) | One or more fields representing independent explanatory variables in your regression model. REST web example: Rate REST scripting example: "explanatoryVariables": "Rating,Nights" |
regressionFamily (Required) | Specifies the type of data you're modeling. regressionFamily is one of the following:
REST web example: Continuous REST scripting example: "regressionFamily": "Binary" |
generateCoefficientTable (Optional) | Determines whether a table with coefficient values will be returned. By default, the coefficient table is not returned. Values: true| false REST web example: false REST scripting example: "generateCoefficientTable": false |
explanatoryVariableMatching (Optional) | A list of the explanatoryVariables specified from the inputLayer and their corresponding fields from the featuresToPredict. By default, if an explanatoryVariable is not mapped, it will match to a field with the same name in the featuresToPredict. This parameter is only used if there is a featuresToPredict input. You do not need to use it if the names and types of the fields match between your two input datasets. Syntax: [{"predictionLayerField":"<field name>", "trainingLayerField": "<field name>"},...] predictionLayerField is the name of a field specified in the explanatoryVariables parameter. trainingLayerField is the field that will match to the field in the explanatoryVariables parameter. REST web example: [{"predictionLayerField":"CrimeType", "trainingLayerField": "TypeOfCrime"},{"predictionLayerField":"population", "trainingLayerField": "population"}] REST scripting example: "variablePredict":[{"predictionLayerField":"isSunny", "trainingLayerField": "isSunny2010"}] |
dependentMapping (Optional) | A list representing the values used to map to 0 (absence) and 1 (presence) for binary regression. Syntax: [{"value0":"<false value>"},{"value1":"<true value>"}] value0 is the string that will be used to represent 0 (absence values). value1 is the string that will be used to represent 1(presence values). REST web example: [{"value0":"NoArrest"},{"value1":"Arrest"}] REST scripting example: [{"value0":"Fail"},{"value1":"Pass"}] |
outputName (Required) | The task will create a feature service of the results. You define the name of the service. REST web example: myOutput REST scripting example: "outputName" : "myOutput" |
context (Optional) | The context parameter contains additional settings that affect task execution. For this task, there are four settings:
Syntax: |
f | The response format. The default response format is html. Values: html | json |
Response
When you submit a request, the service assigns a unique job ID for the transaction.
{
"jobId": "<unique job identifier>",
"jobStatus": "<job status>"
}
After the initial request is submitted, you can use jobId to periodically check the status of the job and messages as described in Checking job status. Once the job has successfully completed, use jobId to retrieve the results. To track the status, you can make a request of the following form:
https://<analysis url>/GeneralizedLinearRegression/jobs/<jobId>
Access results
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:
https://<analysis url>/GeneralizedLinearRegression/jobs/<jobId>/results/output?token=<your token>&f=json
https://<analysis url>/GeneralizedLinearRegression/jobs/<jobId>/results/outputPredicted?token=<your token>&f=json
https://<analysis url>/GeneralizedLinearRegression/jobs/<jobId>/results/coefficientTable?token=<your token>&f=json
https://<analysis url>/GeneralizedLinearRegression/jobs/<jobId>/results/processInfo?token=<your token>&f=json
Parameter | Description |
|---|---|
output |
The input features that are fit to the model. The type of feature (table, point, line, or polygon) depends on the input layers. Request example: The result has properties for parameter name, data type, and value. The contents of value depend on the outputName parameter provided in the initial request. The value contains the URL of the feature service layer. See Feature output for more information about how the result layer is accessed. |
outputPredicted | The features predicted using the model. The type of feature (table, point, line, or polygon) depends on the input layers. This result is optional and is only returned when featureToPredict is provided as input. Request example: |
coefficientTable | A table representing the coefficients from the model fit. This result is optional and is only returned when generateCoefficientTable is true. Request example: |
processInfo | The processInfo parameter contains strings that summarize the Forest-based Classification and Regression result. These strings are used for reporting by the Generalized Linear Regression in the map viewer. You can create your own custom reports for your application using these strings. There are four parts in the returned JSON as follows:
Example: |