Skip to Content.

mget-help - RE: [mget-help] glm, predict glm from table

Please Wait...

Subject: Marine Geospatial Ecology Tools (MGET) help

Text archives


From: "Jason Roberts" <>
To: "'Liza Hoos'" <>
Cc: <>
Subject: RE: [mget-help] glm, predict glm from table
Date: Tue, 25 Sep 2012 18:56:32 -0400

Liza,

 

Yes, the variable names are case sensitive. Ultimately, this is imposed by R.

 

I think you are having trouble with a subtle aspect of the ArcGIS geoprocessing system. If you change a parameter value but only change its case, ArcGIS concludes that the parameter value was NOT changed, so it uses the original case. This causes problems when you simply need to change the case of some parameter’s value. To do that, you first have to change the parameter’s value in some OTHER way, click OK, then change it AGAIN, this time to the case you want.

 

So if the value is currently “month_1” and you want it to be “Month_1”, first change it to “asdf”, then click OK, then open the tool again and change it to “Month_1”, then click OK. Now it should be “Month_1”. If you do not change it to something else first (“asdf”) and try to change directly from “month_1” to “Month_1”, it ignores your change and keeps it at “month_1”.

 

Make sense?

 

Let me know if that helps…

 

Jason

 

From: Liza Hoos [mailto:]
Sent: Tuesday, September 25, 2012 6:41 PM
To: Jason Roberts
Cc:
Subject: Re: [mget-help] glm, predict glm from table

 

Hi Jason,

Oops! I had tried entering factor (Month_1) just as a test when Month_1 didn't work, and accidentally sent you the wrong log.

I think I might know what is causing the problem. When I enter "Month_1" into the constant variable predictors list it shows up as "Month_1" in the list. All good so far. But when I close the tool and open it up again the variable shows up in the list as "month_1" with a lowercase m. I know those lists are case sensitive, so maybe it can't recognize "month_1" when it is looking for "Month_1". But maybe I am reading too much into it. I attached the model output again.

Thanks Jason!
-Liza

On Tue, Sep 25, 2012 at 1:45 PM, Jason Roberts <> wrote:

Liza,

 

The screenshot did not come through, but again the verbose output contains what I needed to see what you meant.

 

If I understand you correctly, you’ve almost got the parameters right. You fitted a model that included Month_1 as a categorical predictor and now you want to predict a raster. To do that, you have to provide a value for Month_1 to be used during the prediction. You have two choices. 1) Provide a raster for that predictor. This is a clunky solution because it will be the same value everywhere. But in older versions of MGET, it was your only option. Now you can 2) provide a constant value as a parameter to the tool. To do that, enter Month_1 for the Constant Predictor Variables parameter and the desired integer value (e.g. 1) for the Constant Values parameter.

 

In the verbose output, it appears that you entered factor(Month_1) for the Constant Predictor Variables. It should work if you just enter Month_1.

 

Let me know if that works.

 

Best,

 

Jason

 

From: Liza Hoos [mailto:]

Sent: Tuesday, September 25, 2012 12:28 PM
To: Jason Roberts
Cc:

Subject: Re: [mget-help] glm, predict glm from table

 

Hi Jason,

That did indeed work, thank you very much!

On another note, I have encountered another problem when using the "Predict GLM from Rasters" tool. I receive the error:
<type 'exceptions.ValueError'>: The predictor variable Month_1 appears in the model's formula but does not appear in the list of model variable names for predictor rasters provided to this tool. Add that predictor variable to the list and try again.


My GLM model formula is: Blacktip_Pres ~ Chla_8day_SW + Slope + Dist2Shr + Bathy2 + SST_8day + factor(Month_1). I ran the tool adding all all variables but Month_1 to both the Raster Predictor Variable and Predictor Rasters lists. Month_1 is a field containing numbers 1-12 indicating the month when data point was recorded, and has no associated raster. I then added Month_1 to the Constant Predictor Variable list, and specified the constant value as 1 (see screenshot). Am I misusing the tool, or is this a bug? See attached file for the debug report.

Thank you so much!
-Liza


On Fri, Sep 21, 2012 at 6:15 PM, Jason Roberts <> wrote:

Liza,

 

That is a bug in MGET that we also recently encountered. I’m sorry you hit it.

 

Thank you for the debug report with verbose logging. That allows me to very quickly confirm it is the same problem. A patched file is attached. To apply it to your system:

 

1.    Make sure you have MGET 0.8a43 installed. (You do—I can see this in the verbose logging—but others reading this message might not.)

 

2.    Shut down all ArcGIS programs.

 

3.    Save the attached file one of the following directories, depending on your version of ArcGIS and Python, overwriting the file that is already there:

 

a.    Arc 9.2 - C:\Python24\Lib\site-packages\GeoEco\Statistics

b.    Arc 9.3 - C:\Python25\Lib\site-packages\GeoEco\Statistics

c.    Arc 10.0 - C:\Python26\ArcGIS10.0\Lib\site-packages\GeoEco\Statistics

d.    Arc 10.1 - C:\Python27\ArcGIS10.1\Lib\site-packages\GeoEco\Statistics

 

Then try again. Please let me know if it works.

 

Best,

 

Jason

 

 

From: Liza Hoos [mailto:]
Sent: Friday, September 21, 2012 5:59 PM
To:
Subject: [mget-help] glm, predict glm from table

 

Hello,

I am trying to run a GLM using MGET tools, but I keep getting an error when I use the Predict GLM from table tool. The error reads: "<type 'exceptions.ValueError'>: too many values to unpack Failed to execute (Predict GLM From Table)."

If I leave the "input table (optional)" field blank, the tool runs without problems. However, when I specify an input table it gives me this error (above, and see attachment for all details). Do you know what could be causing this problem? The table only has 1436 entries and about 15 fields.

Thanks so much!
Liza

 

 

Archives powered by MHonArc.
Top of Page