-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EuroCrops: handle Nones in get_label #2499
base: main
Are you sure you want to change the base?
Conversation
Nice catch! It looks like HCATv2 actually has a class for this:
I wonder if we should use this instead: hcat_code = feature['properties'][self.label_name] or '3399000000' I'm not sure if 0 is ever actually being used or not. Are there any other instances where we return 0? @favyen2 do you remember why you added 0? Just to appease mypy? |
Under Harmonisation with HCAT, it seems I am in favor of removing the print statement that notifies the user each time we hit |
Do you mean for the HCAT code or for the label returned by the I don't think I ran into cases where HCAT code was None or 0 so it may be in a new version of the data or in a geographic area that I did not test. For returning 0 from |
Should we use 3399000000 instead of 0? I can also ask the EuroCrops folks if necessary. |
As far as I know, |
Oh, I guess you are saying that some users might still find it useful to train on the feature, mapping it to an "other" category (which first setting the code to 3399000000 and then mapping it based on the user-provided category list would enable) rather than being limited to mapping it to 0 which matches the background category. I'm not sure the answer to this, it may depend on why there are these weird features in the dataset that don't have a code. I guess the safest would be to mark them invalid but otherwise without digging more into the data I think both are reasonable solutions. |
I'm actually saying the exact opposite. I'm wondering if the background class, None, and "not_known_and_other" should all be mapped to the same value. Otherwise, users will have to add all three to |
I think it would be worth reaching out to EuroCrops people to ask whether |
I think there would be cases where users want to ignore None / not_known_and_other but not background, to try to have the model distinguish areas that are not crop fields. |
Reply from the EuroCrops folks:
|
Does this mean some fields have multiple labels, and only one is used while the rest are mapped to None? If so, it is better not to map None to any other label.
This feels more like background to me. |
Closes #2497
Now we return 0 if hcat_code is None, not rendering the feature.