spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hamstra <m...@clearstorydata.com>
Subject Re: [GitHub] spark pull request: MLI-2: Start adding k-fold cross validation to...
Date Mon, 03 Mar 2014 14:20:26 GMT
'to' is an exception to the usual rule, so (1 to folds).map {... } would be
the best form.


On Mon, Mar 3, 2014 at 1:02 AM, holdenk <git@git.apache.org> wrote:

> Github user holdenk commented on a diff in the pull request:
>
>     https://github.com/apache/spark/pull/18#discussion_r10203849
>
>     --- Diff:
> mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala ---
>     @@ -62,6 +67,20 @@ object MLUtils {
>        }
>
>        /**
>     +   * Return a k element list of pairs of RDDs with the first element
> of each pair
>     +   * containing a unique 1/Kth of the data and the second element
> contain the compliment of that.
>     +   */
>     +  def kFold[T : ClassTag](rdd: RDD[T], folds: Int, seed: Int):
> List[Pair[RDD[T], RDD[T]]] = {
>     +    val foldsF = folds.toFloat
>     +    1.to(folds).map  { fold =>
>     --- End diff --
>
>     So I think
> https://cwiki.apache.org/confluence/display/SPARK/Spark+Code+Style+Guide#SparkCodeStyleGuide-InfixMethodssuggests
that I do
> 1.to instead of 1 to. What do you think?
>
>
> ---
> 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.
> ---
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message