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

Ahmad Ragab commented on FLINK-4438:
------------------------------------

Perhaps I've opened this issue potentially incorrectly, since rereading the 
documentation there is some expected behavior which suggests that it is 
possible to run prediction on a {{DataSet\[LabeledVector\]}} however, when I 
run the example I get:  

{code:java}
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.
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:133)
        at 
org.apache.flink.ml.pipeline.ChainedPredictor$$anon$1.predictDataSet(ChainedPredictor.scala:78)
        at 
org.apache.flink.ml.pipeline.ChainedPredictor$$anon$1.predictDataSet(ChainedPredictor.scala:70)
        at 
org.apache.flink.ml.pipeline.Predictor$class.predict(Predictor.scala:59)
        at 
org.apache.flink.ml.pipeline.ChainedPredictor.predict(ChainedPredictor.scala:39)
        at 
org.appdev12Hart.Job$.delayedEndpoint$org$appdev12Hart$Job$1(Job.scala:45)
        at org.appdev12Hart.Job$delayedInit$body.apply(Job.scala:13)
        at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
        at 
scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
        at scala.App$$anonfun$main$1.apply(App.scala:76)
        at scala.App$$anonfun$main$1.apply(App.scala:76)
        at scala.collection.immutable.List.foreach(List.scala:381)
        at 
scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
        at scala.App$class.main(App.scala:76)
        at org.appdev12Hart.Job$.main(Job.scala:13)
        at org.appdev12Hart.Job.main(Job.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:498)
{code}

> FlinkML Quickstart Guide implies incorrect type for test data
> -------------------------------------------------------------
>
>                 Key: FLINK-4438
>                 URL: https://issues.apache.org/jira/browse/FLINK-4438
>             Project: Flink
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 1.2.0
>            Reporter: Ahmad Ragab
>            Priority: Minor
>             Fix For: 1.2.0
>
>
> https://ci.apache.org/projects/flink/flink-docs-master/apis/batch/libs/ml/quickstart.html
> Documentation under *LibSVM* section says that:
> ----
> We can simply import the dataset then using:
> {code:java}
> import org.apache.flink.ml.MLUtils
> val astroTrain: DataSet[LabeledVector] = 
> MLUtils.readLibSVM("/path/to/svmguide1")
> val astroTest: DataSet[LabeledVector] = 
> MLUtils.readLibSVM("/path/to/svmguide1.t")
> {code}
> This gives us two {{DataSet\[LabeledVector\]}} objects that we will use in 
> the following section to create a classifier.
> ----
> Test data wouldn't be of type {{LabeledVector}} generally, it would be as it 
> is described in other examples as {{DataSet\[Vector\]}} since prediction 
> should generate the labels. Thus after reading the file using {{MLUtils}} it 
> should be mapped to a vector.
> Also, the previous section in *Loading Data* should include an example of 
> using the {{Splitter}} in order to prepare the {{survivalLV}} data for use 
> with a learner. 



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

Reply via email to