-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Do not copy mapping from dependent variable to prediction field in regression analysis #51227
Do not copy mapping from dependent variable to prediction field in regression analysis #51227
Conversation
Pinging @elastic/ml-core (:ml) |
a7fe7f6
to
12a80bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me :D.
I wonder if we should force the mapping for regression to always be double
instead of it being float
? I am not sure if the precision loss is a concern or not.
It's a good point about using |
This change required bigger changes in the logic that calculates mappings as now Regression imposes constant mapping while Classification copies the mapping from dependent variable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good.
There are a bunch of failing tests due to the change :).
* | ||
* @param resultsFieldName name of the results field under which all the results are stored | ||
* @return {@link Map} containing fields for which the mappings should be copied from source index to destination index | ||
* @return {@link List} containing fields for which the mappings should be handled explicitly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @return {@link List} containing fields for which the mappings should be handled explicitly | |
* @return {@link Map} containing fields for which the mappings should be handled explicitly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
b35b069
to
d92811a
Compare
…gression analysis
…ce.field" field in the results
d92811a
to
90b3986
Compare
…gression analysis (elastic#51227)
Currently, in case of regression analysis, the mapping is copied from dependent variable to prediction field.
When the dependent variable is of a discrete type (i.e. integer, long, etc.) the prediction field is indexed as a discrete type as well, increasing total prediction error (MSE, R^2).
This PR addresses that by making prediction field mapped dynamically (as float).
Closes https://github.com/elastic/machine-learning-qa/issues/661