GitHub user yanboliang opened a pull request:

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

    [SPARK-10750] [ML] ML Param validate should print better error information

    Currently when you set illegal value for params of array type (such as 
IntArrayParam, DoubleArrayParam, StringArrayParam), it will throw 
IllegalArgumentException but with incomprehensible error information.
    Take ```VectorSlicer.setNames``` as an example:
    ```scala
    val vectorSlicer = new 
VectorSlicer().setInputCol("features").setOutputCol("result")
    vectorSlicer.setIndices(Array.empty).setNames(Array("f1", "f4", "f1"))
    ```
    It will throw IllegalArgumentException as:
    ```
    vectorSlicer_b3b4d1a10f43 parameter names given invalid value 
[Ljava.lang.String;@798256c5.
    java.lang.IllegalArgumentException: vectorSlicer_b3b4d1a10f43 parameter 
names given invalid value [Ljava.lang.String;@798256c5.
    ```
    We should distinguish the value of array type from primitive type at 
Param.validate(value: T), and we will get better error information.
    ```
    vectorSlicer_3b744ea277b2 parameter names given invalid value [f1,f4,f1].
    java.lang.IllegalArgumentException: vectorSlicer_3b744ea277b2 parameter 
names given invalid value [f1,f4,f1].
    ```

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

    $ git pull https://github.com/yanboliang/spark spark-10750

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

    https://github.com/apache/spark/pull/8863.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 #8863
    
----
commit e007688888db7b5bf6bc9ddd9a0e5db278f538ba
Author: Yanbo Liang <[email protected]>
Date:   2015-09-22T06:27:47Z

    ML Param validate should print better error information

commit d937e87299c76b5c58599cfc85f56c016a32ea1e
Author: Yanbo Liang <[email protected]>
Date:   2015-09-22T06:33:12Z

    fix typos

----


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