Skip to Content.

mget-help - Re: [mget-help] random forest in MGET

Please Wait...

Subject: Marine Geospatial Ecology Tools (MGET) help

Text archives


From: Scott Gunn <>
To: Jason Roberts <>
Cc: Ram Deo <>, Luis Miguel Verissimo <>, <>
Subject: Re: [mget-help] random forest in MGET
Date: Thu, 17 Jan 2013 14:50:41 -0700
Hi Jason and all,

I was just following up on this to see if any solutions have been provided since Ram originally brought up the bug last November.

MGET is giving me the exact same error message on categorical data in the random forest tools.  In my case, the variables in question are land cover and soil classes.  I have tried modifying the formula, e.g. factor(LandCover), factor('LandCover'), factor("LandCover"), etc. to no avail.  I just receive the "object not found" error described below.  I have also tried different field data types for these variables in ArcMap, including short and long integers, float, and string.  I've tried both .dbf tables and feature classes.

I have tried this on both ArcGIS 10.1 and ArcGIS 10.0 and the respective MGET versions for these releases.  Also, as a result, I've tried this on Python 2.6 and 2.7.  Maybe I should try an older versoin of R?  I have only used the latest release, 2.15.2.

Any help would be greatly appreciated.  If you need debug information please let me know.

Thank you,

Scott Gunn
University of New Mexico



On Mon, Nov 5, 2012 at 2:36 PM, Jason Roberts <> wrote:

Dear Ram,

 

Thanks for contacting us about MGET. I’m sorry about the problem you are seeing.

 

I am actively investigating this problem, among others, after being contacted by Luis Miguel Verissimo, a fellow colleague at your institution. Do know him? I added him to the CC list, in case he is interested in this problem as well.

 

The problem is that MGET uses the R randomForest package to fit these models, and that package seems to be limited in the syntax it will accept for model formulas. I can reproduce the error you obtained with your original formula:

 

tot_volcuf ~ modslope + tmndvi20 + avbawht + factor(cover)

 

Apparently the problem relates to how the randomForest package parses the formula and uses it to build an internal representation of the data passed into it. You can work around it with an ugly hack:

 

tot_volcuf ~ modslope + tmndvi20 + avbawht + factor(cover) - cover

 

In R syntax, the - cover means “do not use the variable cover as a predictor”. Well, simply omitting + cover accomplishes the same thing; it prevents cover from being used as a predictor. But by explicitly saying - cover, we trick R into not failing with the message you mentioned.

 

I do not completely understand this at a deep level yet, and I have not provided a full explanation of what I think is going on with R here, but you can try this as a quick workaround. Unfortunately, when you do, I suspect you will still encounter a problem when you try to run the MGET Predict Random Forest From Rasters tool. That tool fails when the model formula includes categorical variables, but for a different reason. I am working on that problem as well.

 

Sorry again for all of these problems. The Random Forest tools are new in MGET and I have not tested them very well. I should be able to provide a solution to these problems this week, however.

 

Best regards,

 

Jason

 

 

From: Ram Deo [mailto:]
Sent: Monday, November 05, 2012 2:58 PM
To:
Subject: [mget-help] random forest in MGET

 

Hello Sir,

 

I am a PhD student at Michigan Technological University, School of Forest Resources and Environmental Science. I found the ArcMap extension "Marine Geospatial Ecology Tools 0.8a45" very interesting, and relavant for my research work. I am trying to apply the "Fit Random Forest Model" to my reference data but I am continously getting an error message. I have one response variable (continuous) and four explanatory variables (one of them categorical) in my training data set. I am trying to fit a model of the form:

 

tot_volcuf ~ modslope + tmndvi20 + avbawht + factor(cover)

 

The error message that I am getting is: Error in factor(cover) : object 'cover' not found.

 

Herewith I have attached my data table. Could you please run the above model with my data? It would be a great help if you could suggest me the necessary steps and would be highly acknowledged.

 

Thanks in advance.

 

Sincerely,

Ram Kumar Deo

Ph.D. Student

School of Forest Resources and Environmental Science

Michigan Technological University

Houghton, MI-94431 

 


Archives powered by MHonArc.
Top of Page