[
https://issues.apache.org/jira/browse/MAHOUT-463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12897664#action_12897664
]
Hui Wen Han edited comment on MAHOUT-463 at 8/12/10 6:04 AM:
-------------------------------------------------------------
package org.apache.mahout.math.hadoop.similarity.vector;
import org.apache.mahout.math.hadoop.similarity.Cooccurrence;
/**
* distributed implementation of euclidean distance as vector similarity measure
*/
public class DistributedEuclideanDistanceVectorSimilarity extends
AbstractDistributedVectorSimilarity {
@Override
protected double doComputeResult(int rowA, int rowB, Iterable<Cooccurrence>
cooccurrences, double weightOfVectorA,
double weightOfVectorB, int numberOfColumns) {
double n = 0.0;
double sumXYdiff2 = 0.0;
for (Cooccurrence cooccurrence : cooccurrences) {
double diff = cooccurrence.getValueA() - cooccurrence.getValueB();
sumXYdiff2 += diff * diff;
n++;
}
return n / (1.0 + Math.sqrt(sumXYdiff2));
}
}
this one is always return n (=cooccurrence.size())
was (Author: huiwenhan):
/**
* 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.math.hadoop.similarity.vector;
import org.apache.mahout.math.hadoop.similarity.Cooccurrence;
/**
* distributed implementation of euclidean distance as vector similarity measure
*/
public class DistributedEuclideanDistanceVectorSimilarity extends
AbstractDistributedVectorSimilarity {
@Override
protected double doComputeResult(int rowA, int rowB, Iterable<Cooccurrence>
cooccurrences, double weightOfVectorA,
double weightOfVectorB, int numberOfColumns) {
double n = 0.0;
double sumXYdiff2 = 0.0;
for (Cooccurrence cooccurrence : cooccurrences) {
double diff = cooccurrence.getValueA() - cooccurrence.getValueB();
sumXYdiff2 += diff * diff;
n++;
}
return n / (1.0 + Math.sqrt(sumXYdiff2));
}
}
this one is always return n (=cooccurrence.size())
> Boolean Data can not get any recommendation by running RecommnenderJob
> ----------------------------------------------------------------------
>
> Key: MAHOUT-463
> URL: https://issues.apache.org/jira/browse/MAHOUT-463
> Project: Mahout
> Issue Type: Test
> Components: Collaborative Filtering
> Affects Versions: 0.4
> Reporter: Hui Wen Han
> Fix For: 0.4
>
> Attachments: MAHOUT-463-2.patch, MAHOUT-463.patch
>
>
> Boolean Preference Data can not get any recommendation by run RecommnenderJob,
> but It can get data using the build in about Aprl.
> It seems that it can not get any data by running RowSimilarityJob
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.