[ 
https://issues.apache.org/jira/browse/FLINK-4886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15598091#comment-15598091
 ] 

ASF GitHub Bot commented on FLINK-4886:
---------------------------------------

GitHub user ch33hau opened a pull request:

    https://github.com/apache/flink/pull/2682

    [FLINK-4886] [docs] Update ML quickstart loading svm test data example

    Thanks for contributing to Apache Flink. Before you open your pull request, 
please take the following check list into consideration.
    If your changes take all of the items into account, feel free to open your 
pull request. For more information and/or questions please refer to the [How To 
Contribute guide](http://flink.apache.org/how-to-contribute.html).
    In addition to going through the list, please provide a meaningful 
description of your changes.
    
    - [X] General
      - The pull request references the related JIRA issue ("[FLINK-4886] 
Example in Machine Learning Quickstart Guide causes error")
      - The pull request addresses only one issue
      - Each commit in the PR has a meaningful commit message (including the 
JIRA id)
    
    - [X] Documentation
      - Documentation has been added for new functionality
      - Old documentation affected by the pull request has been updated
      - JavaDoc for public methods has been added
    
    - [X] Tests & Build
      - Functionality added by the pull request is covered by tests
      - `mvn clean verify` has been executed successfully locally or a Travis 
build has passed
    


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

    $ git pull https://github.com/ch33hau/flink update-ml-quickstart

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

    https://github.com/apache/flink/pull/2682.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 #2682
    
----
commit de49683e7e4724e7db8e7a90aa17701d11cf4794
Author: ch33hau <ch33...@gmail.com>
Date:   2016-10-22T16:13:52Z

    [FLINK-4886] [docs] Update ML quickstart loading svm test data example

----


> Example in Machine Learning Quickstart Guide causes error
> ---------------------------------------------------------
>
>                 Key: FLINK-4886
>                 URL: https://issues.apache.org/jira/browse/FLINK-4886
>             Project: Flink
>          Issue Type: Bug
>          Components: Documentation
>            Reporter: Lim Chee Hau
>            Priority: Minor
>
> Under *Loading Data/LibSVM* files section, loading test data with below line 
> will causes error when execute prediction method *svm.predict(astroTest)*:
> {code}
> val astroTest: DataSet[LabeledVector] = 
> MLUtils.readLibSVM("/path/to/svmguide1.t")
> {code}
> Error will be looks like:
> {noformat}
> Exception in thread "main" java.lang.RuntimeException: There is no 
> PredictOperation defined for org.apache.flink.ml.classification.SVM which 
> takes a DataSet[org.apache.flink.ml.common.LabeledVector] as input.
>       at 
> org.apache.flink.ml.pipeline.Estimator$$anon$1.predictDataSet(Estimator.scala:113)
>       at 
> org.apache.flink.ml.pipeline.Predictor$class.predict(Predictor.scala:59)
>       at org.apache.flink.ml.classification.SVM.predict(SVM.scala:131)
>       at org.apache.flink.quickstart.BatchJob$.main(BatchJob.scala:116)
>       at org.apache.flink.quickstart.BatchJob.main(BatchJob.scala)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:497)
>       at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
> {noformat}
> Because *predict* method expects *DataSet\[Vector\]* instead of 
> *DataSet\[LabeledVector\]*, loading test data with below line will solve the 
> problem:
> {code}
> val astroTest: DataSet[Vector] = 
> MLUtils.readLibSVM("/path/to/svmguide1.t").map(_.vector)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to