You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/08/08 20:28:45 UTC

[jira] [Commented] (MAHOUT-1642) Iterator class within SimilarItems class always misses the first element

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

ASF GitHub Bot commented on MAHOUT-1642:
----------------------------------------

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

    https://github.com/apache/mahout/pull/134#discussion_r36580607
  
    --- Diff: mr/src/test/java/org/apache/mahout/cf/taste/similarity/precompute/SimilarItemsTest.java ---
    @@ -0,0 +1,51 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.mahout.cf.taste.similarity.precompute;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +import org.apache.mahout.cf.taste.impl.TasteTestCase;
    +import org.apache.mahout.cf.taste.impl.recommender.GenericRecommendedItem;
    +import org.apache.mahout.cf.taste.recommender.RecommendedItem;
    +import org.hamcrest.Matchers;
    +import org.junit.Test;
    +
    +public class SimilarItemsTest extends TasteTestCase {
    +
    +  @Test
    +  public void testIterator() {
    +
    +	List<RecommendedItem> recommendedItems = new ArrayList<RecommendedItem>();
    --- End diff --
    
    change this to be JDK 1.7 compliant, the project's on 1.7 since 0.10.0


> Iterator class within SimilarItems class always misses the first element
> ------------------------------------------------------------------------
>
>                 Key: MAHOUT-1642
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-1642
>             Project: Mahout
>          Issue Type: Bug
>          Components: Collaborative Filtering
>    Affects Versions: 0.9
>            Reporter: Guohua Hao
>            Assignee: Suneel Marthi
>              Labels: legacy
>             Fix For: 0.11.1
>
>
> In the next() function of SimilarItemsIterator class within SimilarItems class, variable 'index' is incremented before returning the actual element at that position, therefore the first element when iterating will always be missed.



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