# KeyError encountered: "combined\_factors"

**URL:** <https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837>\
**Category:** Software Support\
**Tags:** root\
**Created:** [June 19, 2024, 1:37pm UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837 "2024-06-19T13:37:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hannah24523](https://avatars.discourse-cdn.com/v4/letter/h/ec9cab/32.png) [@Hannah24523](https://community.naturalcapitalalliance.org/u/Hannah24523)\
**Post date:** [June 19, 2024, 1:37pm UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/1 "2024-06-19T13:37:28Z")

</div>

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](https://community.naturalcapitalalliance.org/uploads/short-url/fqsWTz99dnZSciZi7HD5gTv9K3q.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!  
-Hannah

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [June 20, 2024, 9:06pm UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/2 "2024-06-20T21:06:09Z")

</div>

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!  
James

---

<div class="post-metadata">

**Author:** ![Nadine](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/nadine/32/3216_2.png) [@Nadine](https://community.naturalcapitalalliance.org/u/Nadine)\
**Post date:** [June 21, 2024, 12:47am UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/3 "2024-06-21T00:47:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Hannah24523](https://avatars.discourse-cdn.com/v4/letter/h/ec9cab/32.png) [@Hannah24523](https://community.naturalcapitalalliance.org/u/Hannah24523)\
**Post date:** [June 21, 2024, 1:59am UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/4 "2024-06-21T01:59:51Z")

</div>

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](https://community.naturalcapitalalliance.org/uploads/short-url/e4lpGajdU41LDFxA5W0lt9nLQqW.txt) (7.1 KB)  
[InVEST-ROOT-log-2024-06-21–09\_56\_56.txt](https://community.naturalcapitalalliance.org/uploads/short-url/bkhRpf3sw00hRK5ZjeUyppShlAC.txt) (1.9 KB)

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/2X/8/8fe7d707d69a34de8e87c87f80b85995de6be245.png)

---

<div class="post-metadata">

**Author:** ![Hannah24523](https://avatars.discourse-cdn.com/v4/letter/h/ec9cab/32.png) [@Hannah24523](https://community.naturalcapitalalliance.org/u/Hannah24523)\
**Post date:** [June 21, 2024, 2:03am UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/5 "2024-06-21T02:03:26Z")

</div>

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](https://community.naturalcapitalalliance.org/uploads/short-url/xMksGVy1KUkAI9j2xxUKQv7kayv.txt) (7.7 KB)  
Thank you again.

---

<div class="post-metadata">

**Author:** ![Nadine](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/nadine/32/3216_2.png) [@Nadine](https://community.naturalcapitalalliance.org/u/Nadine)\
**Post date:** [June 21, 2024, 2:16am UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/6 "2024-06-21T02:16:47Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Nadine](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/nadine/32/3216_2.png) [@Nadine](https://community.naturalcapitalalliance.org/u/Nadine)\
**Post date:** [June 21, 2024, 2:21am UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/7 "2024-06-21T02:21:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Hannah24523](https://avatars.discourse-cdn.com/v4/letter/h/ec9cab/32.png) [@Hannah24523](https://community.naturalcapitalalliance.org/u/Hannah24523)\
**Post date:** [June 21, 2024, 2:27am UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/8 "2024-06-21T02:27:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Hannah24523](https://avatars.discourse-cdn.com/v4/letter/h/ec9cab/32.png) [@Hannah24523](https://community.naturalcapitalalliance.org/u/Hannah24523)\
**Post date:** [June 21, 2024, 2:29am UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/9 "2024-06-21T02:29:58Z")

</div>

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!  
-Hannah

---

<div class="post-metadata">

**Author:** ![Nadine](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/nadine/32/3216_2.png) [@Nadine](https://community.naturalcapitalalliance.org/u/Nadine)\
**Post date:** [June 21, 2024, 3:16am UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/10 "2024-06-21T03:16:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Nadine](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/nadine/32/3216_2.png) [@Nadine](https://community.naturalcapitalalliance.org/u/Nadine)\
**Post date:** [June 21, 2024, 6:48pm UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/11 "2024-06-21T18:48:32Z")

</div>

Hannah, here’s a link for you to download my version of root. Please let me know if that works. [root64\_Mar2019.zip - Google Drive](https://drive.google.com/file/d/150Fc6Nh_L9GeoVoe97pMFNQPQ9PHMpHz/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![swolny](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/swolny/32/181_2.png) [@swolny](https://community.naturalcapitalalliance.org/u/swolny)\
**Post date:** [June 24, 2024, 5:50pm UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/12 "2024-06-24T17:50:50Z")

</div>

Split this topic on June 24, 2024, 5:50pm UTC

5 posts were split to a new topic: [Help with habitat quality model](https://community.naturalcapitalalliance.org/t/help-with-habitat-quality-model/4843)

---

<div class="post-metadata">

**Author:** ![Hannah24523](https://avatars.discourse-cdn.com/v4/letter/h/ec9cab/32.png) [@Hannah24523](https://community.naturalcapitalalliance.org/u/Hannah24523)\
**Post date:** [June 22, 2024, 2:01am UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/14 "2024-06-22T02:01:41Z")

</div>

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!  
-Hannah

---

<div class="post-metadata">

**Author:** ![Hannah24523](https://avatars.discourse-cdn.com/v4/letter/h/ec9cab/32.png) [@Hannah24523](https://community.naturalcapitalalliance.org/u/Hannah24523)\
**Post date:** [June 22, 2024, 2:13am UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/15 "2024-06-22T02:13:16Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Nadine](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/nadine/32/3216_2.png) [@Nadine](https://community.naturalcapitalalliance.org/u/Nadine)\
**Post date:** [June 22, 2024, 7:24pm UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/17 "2024-06-22T19:24:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Hannah24523](https://avatars.discourse-cdn.com/v4/letter/h/ec9cab/32.png) [@Hannah24523](https://community.naturalcapitalalliance.org/u/Hannah24523)\
**Post date:** [June 23, 2024, 8:44am UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/19 "2024-06-23T08:44:48Z")

</div>

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](https://community.naturalcapitalalliance.org/uploads/short-url/glzs5zUGELoE82T5M0OVuBJykuf.txt) (9.2 KB)

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/2X/1/1a717f2b09ded67f160bf3c3927b0301ab28fc9e.jpeg)

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](https://community.naturalcapitalalliance.org/uploads/short-url/uFriXkscWc7vzwIZCNcSKM0kBuG.txt) (4.6 KB)

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/2X/a/a6299eccd304669e3271f6f8b93d11f8c80287fb.jpeg)  
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!

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [June 24, 2024, 8:17pm UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/20 "2024-06-24T20:17:00Z")

</div>

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,  
James

---

<div class="post-metadata">

**Author:** ![Hannah24523](https://avatars.discourse-cdn.com/v4/letter/h/ec9cab/32.png) [@Hannah24523](https://community.naturalcapitalalliance.org/u/Hannah24523)\
**Post date:** [June 26, 2024, 12:34pm UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/21 "2024-06-26T12:34:31Z")

</div>

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!

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/2X/5/5e96ffa7d54e3fe9926b4eab0db48b0fd608d02d.png)

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”.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/2X/1/1a80e8be295c16fc23430dc26987cb6722c11deb.png)

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!

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [June 27, 2024, 10:56pm UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/22 "2024-06-27T22:56:37Z")

</div>

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!  
James

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/2X/8/8d95591aa074da87ea0fdd61ca47c1c3c0588aa7.png) [@system](https://community.naturalcapitalalliance.org/u/system)\
**Post date:** [July 7, 2026, 5:51pm UTC](https://community.naturalcapitalalliance.org/t/keyerror-encountered-combined-factors/4837/23 "2026-07-07T17:51:24Z")

</div>

Closed on July 7, 2026, 5:51pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
