You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@predictionio.apache.org by dszeto <gi...@git.apache.org> on 2017/05/04 16:05:59 UTC

[GitHub] incubator-predictionio-template-attribute-based-classifier pull request #5: ...

Github user dszeto commented on a diff in the pull request:

    https://github.com/apache/incubator-predictionio-template-attribute-based-classifier/pull/5#discussion_r114821537
  
    --- Diff: src/main/scala/Engine.scala ---
    @@ -3,11 +3,13 @@ package org.template.classification
     import io.prediction.controller.EngineFactory
     import io.prediction.controller.Engine
     
    -class Query(
    -  val attr0 : Double,
    -  val attr1 : Double,
    -  val attr2 : Double
    -) extends Serializable
    +class Query extends Serializable{
    +  var attrs: Seq[Double] = null
    +  def this(attrs: Double*) {
    +    this()
    +    this.attrs = attrs
    +  }
    +}
    --- End diff --
    
    Hey @mzjgithub , wondering why we need to have an auxiliary constructor here. Can we simply have
    
    ```scala
    class Query(val attrs: Seq[Double]) extends Serializable
    ```
    
    ?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---