KeyError encountered: "combined_factors"

Hi everyone,
When I was learning to use the ROOT tool to optimize the example data, I entered it without any errors or warnings, but unfortunately, I got an error after clicking “run”:
Key Error encountered: “combined_factors”
InVEST-ROOT-log-2024-06-19–21_13_50.txt (1.9 KB)
I’m not sure what the error is, so if you can help me solve the problem or provide suggestions for communication, thank you very much!

Hello @Hannah24523,

Thanks for including your logfile! Based on the source code from this version of ROOT, it appears that you will need to have ROOT do its preprocessing if you also want ROOT to do its optimization.

Please let us know if you have any further questions!

Hi Hannah, even though it’s not clear on the interface or in the documentation, you need to run the preprocessing step first and then the optimization. If you try to do both at the same time, it will fail.

Hello James,
Thank you for your reply, I’ve done the preprocessing step using ROOT and then optimized, but unfortunately still encountering the same error.
InVEST-ROOT-log-2024-06-21–09_56_40.txt (7.1 KB)
InVEST-ROOT-log-2024-06-21–09_56_56.txt (1.9 KB)

Hi Nadine,
Thanks for the suggestion, but I didn’t use ROOT to prep and optimize at the same time, so there may be other reasons to consider.
If both preprocessing and optimization are checked, ROOT gives back the error:
UFuncTypeError encountered: ufunc ‘multiply’ did not contain a loop with signature matching types (dtype(‘float 64’), dtype (’ None See the log for details.
InVEST-ROOT-log-2024-06-21–09_52_30.txt (7.7 KB)
Thank you again.

Sorry, either I’m not understanding your not explaining it well. You cannot run ROOT with both boxes checked. You need to first run the top preprocessing section, then uncheck it and run the optimization session. Is that what you’re doing?

Can you also make sure all of of the paths have the same slash direction. Navigate to the folders to ensure they are correct.
I see your version is different than mine, so tomorrow I’ll send you my version of ROOT.

Hi Nadine,
I did the optimization after successfully preprocessing the data first, without checking both checkboxes.I’m still getting the same error so it’s a bit of a struggle.
Thank you for your prompt response.

Hi Nadine,
It would be great if you could share the ROOT you used, thanks a lot!
Thank you for your advice and support and I look forward to hearing from you again!

Hi Hannah, I’m not at my computer now, so will share my version tomorrow. Meanwhile, if you want to zip up your tables and inputs, I can troubleshoot and try to run on mine.

Hannah, here’s a link for you to download my version of root. Please let me know if that works. - Google Drive

5 posts were split to a new topic: Help with habitat quality model

Hi Nadine,
Thank you so much for your prompt reply, it helped me a lot. I am now trying to download the link you shared and if it runs successfully I will share the joyful news with you in time!

Hi imtiaz,
I am also a new learner to the ROOT model and am very unfamiliar with the use of many of the features. I have no access to the difficulties you are experiencing, so I have no way to give you effective help and feedback, I’m very sorry!
If you have solved this dilemma through other means, you can also share it here to help more people!

Hi imtiaz, sorry you’re having problems with the models. Can you please send me the log files. They will be txt files in your outputs folder.

Hi Nadine,
After I downloaded the link you shared, running it turned out to be a good solution to the problem I was experiencing before, thank you very much.
But unfortunately, I did the preprocessing first and it worked.
root-log-2024-06-23–15_50_33.txt (9.2 KB)

However, when I ran the optimization process, a new error appeared.
ValueError encountered: invalid “weight” value : 0
root-log-2024-06-23–16_30_09.txt (4.6 KB)

I’m not sure what is causing the error and am actively trying and seeking help.If you know how to fix this effectively, please let me know at your convenience!
Thank you!

Sorry @Hannah24523 , this version of ROOT is ancient. It’s so old that I don’t even know exactly what version of ROOT is running. This unfortunately means that I can’t look at the source code and it’s close to impossible to provide support. The only thing I can guess is that instead of a numerical weight, it might be asking for either min or max, but that’s just a guess.

If you would like any degree of support using ROOT, please download the latest version of ROOT from the NatCap website so we can at least be able to look more closely at what is going on. Please keep in mind that we are not currently able to support ROOT as well as we would like to, so any support we can provide will be limited.

Thanks and sorry for the inconvenience,

Hi James,
Thank you for your advice and help. When I first started learning to use ROOT, it was from the natcap website that I downloaded ROOT version 3.12.1. Unfortunately, the AOI shapefile in the data preprocessing stage, although flagged as optional, are actually mandatory input items. Also, some errors were encountered while performing data optimization: analysis type was always unavailable!

I found other versions of ROOT shared by others by browsing the site for problems others have had. Downloading it worked well to solve the two problems I encountered above, but a new problem arose:
Key Error encountered: “combined_factors”.

So, I’m re-posting this thread to ask for help, and thank you very much for your help on many occasions and for the ROOT kit.The new issues (ValueError encountered: invalid “weight” value : 0) that have arisen with this version of ROOT have not yet been resolved, but thank you very much for your continued help and advice. I will try my best to find a solution through multiple channels afterward, and if there are any other developments I will state them below this post, so hopefully I can share the learning progress with more people.
Thank you!

Again, there is a very limited amount that I can actually help with here.

For the “weight” error, I believe this needs to be either “min” or “max”, not 0.

Sorry I can’t be of more help!