GitHub user MLnick opened a pull request:

    https://github.com/apache/spark/pull/12577

    [SPARK-14489][SPARK-14153][ML][PYSPARK] Support dropping NaN predicted 
values in RegressionEvaluator

    As discussed in 
[SPARK-14489](https://issues.apache.org/jira/browse/SPARK-14489), when using 
`ALSModel` to predict on a test set, the model returns `NaN` when the user/item 
is in the test set but not the training set, since the model has not computed 
factor(s) for that user and/or item. 
    
    This PR adds support to `RegressionEvaluator` to drop rows where the value 
of `predictionCol` is `NaN`. This should not be used in the general case (since 
a bad regression model may produce a lot of `NaN`s and one would not want to 
ignore those but rather fix the underlying issue), but allows ALS to be used in 
cross-validation settings even when this situation occurs (which may be quite 
common on larger, sparser datasets). Thus it is an `expertParam` and the 
default is `false`. 
    
    ## How was this patch tested?
    
    New unit tests in `RegressionEvaluatorSuite` and doc string tests in 
`evaluation.py`.
    
    cc @srowen @sethah

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MLnick/spark SPARK-14489-dropnan-evaluator

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/12577.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #12577
    
----
commit bfe510c88efeb6243cdbbbb753ac5f502116a8a7
Author: Nick Pentreath <[email protected]>
Date:   2016-04-21T14:34:34Z

    Support dropping NaN predicted values in RegressionEvaluator

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to