You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Dmitriy Lyubimov (JIRA)" <ji...@apache.org> on 2014/03/28 03:31:15 UTC

[jira] [Comment Edited] (MAHOUT-1493) Port Naive Bayes to the Spark DSL

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

Dmitriy Lyubimov edited comment on MAHOUT-1493 at 3/28/14 2:30 AM:
-------------------------------------------------------------------

I don't think you meant run() to return Unit. 

Also I am not sure using a class is justified.

In most cases, i would favor dropping classes in favor of functions, albeit with fairly long parameter list but populaed with default values.

The pattern i am following is to create a pithy and expressive name (such as ssvd()) for a function (in this case could be something like "trainNB") inside a scala object (singleton) and then re-translate that as top-level package function so one can say something like 

{code}
import decompositions._
val nbmodel = trainNB(...)
...
{code}





was (Author: dlyubimov):
I don't think you meant run() to return Unit. 

Also I am not sure using a class is justified.

In most cases, i would favor dropping classes in favor of functions, albeit with fairly long parameter list but populaed with default values.

The pattern i am following is (1) to create a pithy and expressive name (such as ssvd()) for a function (in this case could be something like "trainNB") inside a scala object (singleton) and then re-translate that as top-level package function so one can say something like 

{code}
import decompositions._
val nbmodel = trainNB(...)
...
{code}


> Port Naive Bayes to the Spark DSL
> ---------------------------------
>
>                 Key: MAHOUT-1493
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-1493
>             Project: Mahout
>          Issue Type: Bug
>          Components: Classification
>            Reporter: Sebastian Schelter
>            Assignee: Sebastian Schelter
>             Fix For: 1.0
>
>         Attachments: MAHOUT-1493.patch
>
>
> Port our Naive Bayes implementation to the new spark dsl. Shouldn't require more than a few lines of code.



--
This message was sent by Atlassian JIRA
(v6.2#6252)