-
Notifications
You must be signed in to change notification settings - Fork 1
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
ValueError: Input X contains NaN #17
Comments
Are any of the magnitude errors negative or zero? I see the actual error message above is:
so when it's taking the log of the magnitude errors. It doesn't look like there's a check for unphysical magnitude errors in the code, so having bad values could cause the error. We can add a check and maybe put in a minimum magnitude error value to eliminate the errors. In general, though, it's good to make sure the input data is cleaned from such unphysical features before running any photo-z code. |
Sam, yes, there are negative magnitude errors. I've sliced the original test file in two, one that contains rows with negative magnitude errors and another that contains rows with NaN magnitude errors. The output of estimating each file follows. Do you plan to add these checks in the GPZ code ? Thanks, Negative magnitude errors:
NaN magnitude errors:
|
I can put in a check and replacement value for the negative and np.nan magnitude uncertainties, and a new config param that sets a value to replace those with (I'll ad hoc set a default value of maybe 0.1 for a large but not outrageously large magnitude error). This may or may not eventually get replaced if we decide to do a more standardized input sanitization in RAIL, as I am guessing that issues like this may pop up more often when we start playing with data that has more varied values as inputs. I'll see if I can get a PR in fairly quickly with the fix. |
@hdante I think the pull request that I just merged should fix this issue, note that there is a new configuration parameter now, |
Nice, thank you Sam, I'll test it. |
Hello, when estimating with GPZ, if some magnitude error columns contain NaN, estimation stops with a
ValueError
exception.Note: tried with
nondetect_val=np.nan
and without settingnondetect_val
.Before submitting
Please check the following:
The text was updated successfully, but these errors were encountered: