- URL:
- https://<geoanalytics-url>/GeneralizedLinearRegression
- Methods:
GET
- Version Introduced:
- 10.7
Description
This tool performs generalized linear regression (GLR) to generate predictions or to model a dependent variable's relationship to a set of explanatory variables. The Generalized
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 use?
- 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?
Request parameters
Parameter | Details |
---|---|
| The layer containing the dependent and independent variables. Syntax: As described in Feature input, this parameter can be one of the following:
REST examples
|
| 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:
REST examples
|
| The numeric field containing the observed values to be modeled. REST examples
|
| One or more fields representing independent explanatory variables in the regression model. REST examples
|
| Specifies the type of data to be modeled. This parameter can be defined as one of the following:
REST examples
|
| Specifies whether a table with coefficient values will be returned. By default, the coefficient table is not returned. Values: REST examples
|
| A list of the
REST examples
|
| A list representing the values used to map to 0 (absence) and 1 (presence) for binary regression. REST examples
|
|
The task will create a feature service of the results. You define the name of the service. REST examples
|
|
The
Syntax:
|
|
The response format. The default response format is Values: |
Example usage
The following is a sample request URL for Generalized
:
https://machine.domain.com/webadaptor/rest/services/System/GeoAnalyticsTools/GPServer/GeneralizedLinearRegression/submitJob?predictionType=Train&inputLayer={"url":"https://webadaptor.domain.com/server/rest/services/Hurricane/hurricaneTrack2017/0"}&featuresToPredict={"url":"https://webadaptor.domain.com/server/rest/services/Hosted/corpusChristi/0"}&dependentVariable=ShelterCapacity&explanatoryVariables=CityDensity, ShelterLocations®ressionFamily=Binary&generateCoefficientTable=false&explanatoryVariableMatching=[{"predictionLayerField":"Hurricane2019","trainingLayerField":"hurricanesIn2019"},{"predictionLayerField":"ShelterLocations","trainingLayerField":"CorpusChristiShelters"}]&dependentMapping=[{"value0":"Shelter"},{"value1":"NoShelter"}]&outputName=myOutput&context={"extent":{"xmin":-122.68,"ymin":45.53,"xmax":-122.45,"ymax":45.6,"spatialReference":{"wkid":4326}}}&f=json
Response
When you submit a request, the service assigns a unique job ID for the transaction.
Syntax:
{
"jobId": "<unique job identifier>",
"jobStatus": "<job status>"
}
After the initial request is submitted, you can use job
to periodically check the status of the job and messages as described in Check job status. Once the job has successfully completed, use job
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 esri
, you can access the results of the analysis by making a request of the following form:
https://<analysis-url>/GeneralizedLinearRegression/jobs/<jobId>/results/<response type>?token=<your token>&f=json
Response | Description |
---|---|
| The input features that are fit to the model. The type of feature (table, point, line, or polygon) depends on the input layers.
The result has properties for parameter name, data type, and value. The contents of
See Feature output for more information about how the result layer is accessed. |
| 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
|
| A table representing the coefficients from the model fit. This result is optional and is only returned when
|
| The
|